|
44152
|
1604
|
18
|
2026-05-14T13:36:32.301320+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778765792301_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteAccountJob.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
NULL
|
NULL
|
NULL
|
NULL
|
click
|
NULL
|
NULL
|
NULL
|
44150
|
NULL
|
NULL
|
NULL
|
|
44151
|
1603
|
20
|
2026-05-14T13:36:32.291592+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778765792291_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteAccountJob.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1234920426369963436
|
-7196396190330140245
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
PostmanFileEditViewWindowHelp(ah)→X Hubspot vQ SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaboration.ET next •POST Re: •POST Re: •GET Rei •GET Read CGET http:IteratiorPOST searcD IteratiorGET get l •GET Re: •POST filte •=+ ...Iteration run Search HS (#15)V COLLECTIONS› Associations› Associations V4> CMS - URL Redirects API Collection› Companies› COMPARE› Contacts› CRM Objects› CRM Owners> CRM Pipelines› Deals› Engagements› Hubspot› Iteration run HSv Iteration run Search HSPOST search contact by email Copy› Journal & webhoooks v4› OAuth› Properties› RESEARCHv SEARCHPOST search contact by phonePOST search contact by emailPOST search meetingsPOST search notes> POST Search calls v3> ENVIRONMENTS› SPECS› FLOWSConnect GitE ConsoleTerminal• Iteration run Search HS - 20 VUs • May 14, 2026 16:34:08 (1 min) - Fixed profileSummaryTestsErrorsTotal requests sent O15,441Requests/second O256.05Avg. response time ©65 msP90 ©78 msP95 ©85 msP99 ©118 msError % ©0.00Failure % ©0.00% 1008060402016:34:1116:34:1716:34:2316:34:2916:34:3516:34:4116:34:4716:34:5316:34:59- Requests/second- Avg. response— Error %Performance details for total durationRequestTotal requestsRequests/sError %Failure %Resp. time (Avg. ms)Min (ms)POST search contact by email...15,441255.[PHONE]50100% <78 • Thu 14 May16:36:31InviteUpgrade[ Iteration+No environment v₴Run AgainSharePeak CPU % ©93.6%Peak Memory % ©18.8 %Filter by requestsAvg. response108 ms300 req/s100250802006015040100205016:35:05Virtual users**•CPU %•*• Memory %Max (ms)235P9078.••Globals VaultTools...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
44150
|
1604
|
17
|
2026-05-14T13:36:29.453647+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778765789453_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteAccountJob.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Enums\CrmObject;
use Jiminny\Jobs\Job;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Repositories\Crm\AccountRepository;
use Psr\Log\LoggerInterface;
use Throwable;
class DeleteAccountJob extends Job implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use DeleteCrmEntityTrait;
private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;
public function __construct(private readonly int $id)
{
$this->onQueue(Constants::QUEUE_CRM_SYNC);
}
public function handle(
AccountRepository $accountRepository,
ActivityRepository $activityRepository,
Dispatcher $dispatcher,
LoggerInterface $logger,
Connection $db
): void {
try {
$account = $accountRepository->findWithTrashed($this->id);
if ($account === null || ! $account->trashed()) {
$logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [
'account' => $this->id,
'crm_provider_id' => $account?->getCrmProviderId(),
]);
return;
}
$db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {
$activities = $activityRepository->getAccountActivities($account);
$this->handleActivities($activities, $dispatcher, $logger);
// Nullify one-to-many relationships
$accountRepository->nullifyContactReferences($account);
// Check if opportunities exist before deletion
if ($accountRepository->hasOpportunities($account)) {
$logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [
'account' => $this->id,
'opportunity_count' => $accountRepository->countOpportunities($account),
]);
return;
}
// Delete dependent records
$logger->info($this->getLogPrefix() . ' Delete data', [
'account' => $this->id,
'data' => $account->data()->get()->toArray(),
]);
$account->data()->delete();
$logger->info($this->getLogPrefix() . ' Delete subscriptions', [
'account' => $this->id,
'subscriptions' => $account->subscriptions()->get()->toArray(),
]);
$account->subscriptions()->delete();
// Update conversion references
$accountRepository->nullifyLeadConversionReferences($this->id);
$logger->info($this->getLogPrefix() . ' Delete account', [
'account' => $this->id,
'account_object' => $account->toArray(),
]);
$account->forceDelete();
});
} catch (Throwable $e) {
$logger->error($this->getLogPrefix() . ' Account deletion failed', [
'account' => $this->id,
'attempt' => $this->attempts(),
'error' => $e->getMessage(),
]);
throw $e;
}
}
protected function getLogPrefix(): string
{
return '[Delete] [Account]';
}
protected function getEntityType(): CrmObject
{
return self::ENTITY_TYPE;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.122340426,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.82413566,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8394282,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.66788566,"top":0.10055866,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.6775266,"top":0.09896249,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.68484044,"top":0.09896249,"width":0.006981383,"height":0.018355945},"on_screen":true,"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\\Crm\\Delete;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Repositories\\Crm\\AccountRepository;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass DeleteAccountJob extends Job implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n use DeleteCrmEntityTrait;\n\n private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;\n\n public function __construct(private readonly int $id)\n {\n $this->onQueue(Constants::QUEUE_CRM_SYNC);\n }\n\n public function handle(\n AccountRepository $accountRepository,\n ActivityRepository $activityRepository,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n Connection $db\n ): void {\n try {\n $account = $accountRepository->findWithTrashed($this->id);\n\n if ($account === null || ! $account->trashed()) {\n $logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [\n 'account' => $this->id,\n 'crm_provider_id' => $account?->getCrmProviderId(),\n ]);\n\n return;\n }\n\n $db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {\n $activities = $activityRepository->getAccountActivities($account);\n $this->handleActivities($activities, $dispatcher, $logger);\n\n // Nullify one-to-many relationships\n $accountRepository->nullifyContactReferences($account);\n\n // Check if opportunities exist before deletion\n if ($accountRepository->hasOpportunities($account)) {\n $logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [\n 'account' => $this->id,\n 'opportunity_count' => $accountRepository->countOpportunities($account),\n ]);\n\n return;\n }\n\n // Delete dependent records\n $logger->info($this->getLogPrefix() . ' Delete data', [\n 'account' => $this->id,\n 'data' => $account->data()->get()->toArray(),\n ]);\n $account->data()->delete();\n\n $logger->info($this->getLogPrefix() . ' Delete subscriptions', [\n 'account' => $this->id,\n 'subscriptions' => $account->subscriptions()->get()->toArray(),\n ]);\n $account->subscriptions()->delete();\n\n // Update conversion references\n $accountRepository->nullifyLeadConversionReferences($this->id);\n\n $logger->info($this->getLogPrefix() . ' Delete account', [\n 'account' => $this->id,\n 'account_object' => $account->toArray(),\n ]);\n $account->forceDelete();\n });\n\n } catch (Throwable $e) {\n $logger->error($this->getLogPrefix() . ' Account deletion failed', [\n 'account' => $this->id,\n 'attempt' => $this->attempts(),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n }\n\n protected function getLogPrefix(): string\n {\n return '[Delete] [Account]';\n }\n\n protected function getEntityType(): CrmObject\n {\n return self::ENTITY_TYPE;\n }\n}","depth":4,"bounds":{"left":0.12765957,"top":0.09736632,"width":0.56416225,"height":0.8818835},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Repositories\\Crm\\AccountRepository;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass DeleteAccountJob extends Job implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n use DeleteCrmEntityTrait;\n\n private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;\n\n public function __construct(private readonly int $id)\n {\n $this->onQueue(Constants::QUEUE_CRM_SYNC);\n }\n\n public function handle(\n AccountRepository $accountRepository,\n ActivityRepository $activityRepository,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n Connection $db\n ): void {\n try {\n $account = $accountRepository->findWithTrashed($this->id);\n\n if ($account === null || ! $account->trashed()) {\n $logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [\n 'account' => $this->id,\n 'crm_provider_id' => $account?->getCrmProviderId(),\n ]);\n\n return;\n }\n\n $db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {\n $activities = $activityRepository->getAccountActivities($account);\n $this->handleActivities($activities, $dispatcher, $logger);\n\n // Nullify one-to-many relationships\n $accountRepository->nullifyContactReferences($account);\n\n // Check if opportunities exist before deletion\n if ($accountRepository->hasOpportunities($account)) {\n $logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [\n 'account' => $this->id,\n 'opportunity_count' => $accountRepository->countOpportunities($account),\n ]);\n\n return;\n }\n\n // Delete dependent records\n $logger->info($this->getLogPrefix() . ' Delete data', [\n 'account' => $this->id,\n 'data' => $account->data()->get()->toArray(),\n ]);\n $account->data()->delete();\n\n $logger->info($this->getLogPrefix() . ' Delete subscriptions', [\n 'account' => $this->id,\n 'subscriptions' => $account->subscriptions()->get()->toArray(),\n ]);\n $account->subscriptions()->delete();\n\n // Update conversion references\n $accountRepository->nullifyLeadConversionReferences($this->id);\n\n $logger->info($this->getLogPrefix() . ' Delete account', [\n 'account' => $this->id,\n 'account_object' => $account->toArray(),\n ]);\n $account->forceDelete();\n });\n\n } catch (Throwable $e) {\n $logger->error($this->getLogPrefix() . ' Account deletion failed', [\n 'account' => $this->id,\n 'attempt' => $this->attempts(),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n }\n\n protected function getLogPrefix(): string\n {\n return '[Delete] [Account]';\n }\n\n protected function getEntityType(): CrmObject\n {\n return self::ENTITY_TYPE;\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.69348407,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.70212764,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.7130984,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.72174203,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.73038566,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.7413564,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.75232714,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"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.77892286,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.7898936,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"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.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.93517286,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.94514626,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.9544548,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9644282,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9740692,"top":0.12210695,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.12210695,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3453605086229467958
|
6686328802887799389
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Enums\CrmObject;
use Jiminny\Jobs\Job;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Repositories\Crm\AccountRepository;
use Psr\Log\LoggerInterface;
use Throwable;
class DeleteAccountJob extends Job implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use DeleteCrmEntityTrait;
private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;
public function __construct(private readonly int $id)
{
$this->onQueue(Constants::QUEUE_CRM_SYNC);
}
public function handle(
AccountRepository $accountRepository,
ActivityRepository $activityRepository,
Dispatcher $dispatcher,
LoggerInterface $logger,
Connection $db
): void {
try {
$account = $accountRepository->findWithTrashed($this->id);
if ($account === null || ! $account->trashed()) {
$logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [
'account' => $this->id,
'crm_provider_id' => $account?->getCrmProviderId(),
]);
return;
}
$db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {
$activities = $activityRepository->getAccountActivities($account);
$this->handleActivities($activities, $dispatcher, $logger);
// Nullify one-to-many relationships
$accountRepository->nullifyContactReferences($account);
// Check if opportunities exist before deletion
if ($accountRepository->hasOpportunities($account)) {
$logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [
'account' => $this->id,
'opportunity_count' => $accountRepository->countOpportunities($account),
]);
return;
}
// Delete dependent records
$logger->info($this->getLogPrefix() . ' Delete data', [
'account' => $this->id,
'data' => $account->data()->get()->toArray(),
]);
$account->data()->delete();
$logger->info($this->getLogPrefix() . ' Delete subscriptions', [
'account' => $this->id,
'subscriptions' => $account->subscriptions()->get()->toArray(),
]);
$account->subscriptions()->delete();
// Update conversion references
$accountRepository->nullifyLeadConversionReferences($this->id);
$logger->info($this->getLogPrefix() . ' Delete account', [
'account' => $this->id,
'account_object' => $account->toArray(),
]);
$account->forceDelete();
});
} catch (Throwable $e) {
$logger->error($this->getLogPrefix() . ' Account deletion failed', [
'account' => $this->id,
'attempt' => $this->attempts(),
'error' => $e->getMessage(),
]);
throw $e;
}
}
protected function getLogPrefix(): string
{
return '[Delete] [Account]';
}
protected function getEntityType(): CrmObject
{
return self::ENTITY_TYPE;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
44149
|
1604
|
16
|
2026-05-14T13:36:27.097827+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778765787097_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteAccountJob.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
codeFV faVsco.js#12066 on JY-20725-handle-HS-searc codeFV faVsco.js#12066 on JY-20725-handle-HS-search-rate-limit kroledeyD CrmT DeleteCrmentity Irai.ong© DeleteAccountJob.php X© DetachActivityObject.phpv D Deletes:ohp• DeleteAccountJodC) DelerecontactJob.declarelscrict-cypes=1)u Deletecrmenutyirac) DelereLeaaJob.ononamespace Jiminny Jobs Crm Delete:© DeleteOpportunity-C) VeritvActivityermi› use ...>W Hubspot>W Salestorceclass DeleteaccountJob extends Job 1mplements Shouldoueuel(C) AutoloaDelavedToermC) CheckAndRetrvRemotiuse "spatchable:c) createFollowuoActivituse InteractsWithQuevec) createNotes.onouse Queveable(C) MatchActivitiesToNewuse Deletecrmentitvirait:(C) MatchActivitvCrmDatal(E) [EMAIL]) SaveActivitv.oholusageprivate const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;© SaveTranscription.php© SetupLayout.php© SyncActivity.php© SyncFieldMetadata.phpublic function __construct(private readonly int $id)f...}public function handled© SyncHubspotObjects.rAccountRepository $accountRepository,syncleaas.ongActivityRepository $activityRepository.© SyncObjects.phpuisparcher sarspaucher© SyncOpportunitiesJobLoggerinterrace slogger,© SyncOpportunity.php© SyncProfileMetadata.rconneccion sab© SyncTeamFieldsJob.pl 104C SyncTeamMetadata.pl 105 G*(c) UpdateOpportunityspprotected function getLogPrefix0: string{...}c) Updatestage.pho110 6tprotected function getEntityType(): Crm0biectf...}> C DealRisks— Mallbox→ → Meetina3o1Midd leware(C) HandleHubsootRateLirC) RateLimited.ohoStreaminalTeamM TelenhonvMuser© ChangeEmailJob.php@ Deactivatellser.loh.nh(C) DeleteScheduledUlser/(C) SetunDefaultSavedSe:C SvncTolntercom.nhn© SyncToPlanhat.php© SyncToUserPilot.php© BaseProcessingJob.php(e) Nummy lnh nhnl©PlaybackController.php©) SendReportJob.phpRematchActivityOnCrmObjectDetach.php© MatchActivityCrmData.php© Client.phpOhuospotraginatlonservice.pnghandlenuospotkateLlmit.onpFind in Files 42 matches in 15 tilles• DeleteAccountJobIn Project ModuleDirectory ScopeDeleteAccountJob:disoatch/saccountld)se Jiminny\Jobs|Crm \Delete DeleteAccountJobDeleteAccountJob::dispatch(Saccount->getld()ise Jiminny\Jobs\Crm\Delete DeleteAccountJobDeleteAccountJob::dispatch(Saccount->getld()):class DeleteAccountJob extends Job implements ShouldQueueuse Jiminny\Jobs\Crm\Delete\DeleteAccountJobAccount::class => new DeleteAccountJob(Smodelld),use Jiminny\Jobs\Crm\Delete\DeleteAccountJobDeleteAccountJob::dispatch(Sid)->afterCommit())use Jiminny|Jobs\Crm\Delete DeleteAccountJobSentity instanceof Account => DeleteAccountJob::dispatch(Sentity->getld().use Jiminny| Jobs\Crm\Delete DeleteAccountJobQueue::assertPushed(DeleteAccountJob::class, function (Siob) use (Saccountld)DeleteOpportunitv.Job.phv app/Jobs/Crm/Deleteprivate function handleSoftDeletedAccount(Opportunity SopportunityAccountkepos1tory saccountkepos1tory.LoggerInterface $logger): void {saccountld = sopportunity->qetaccountidoif (SaccountId === null) {File mask: *-phpX5 Cc W *DeleteOpportunityJob.php 138AccountController.php 10AccountController.ohn 78ContactController.php 11ContactController.nho 86DeleteAccountJob.php 21RemoteCrmRecordDeletedListener.php 13RemoteCrmRecordDeletedListener.pnp 103Hubspot/../SyncCrmEntitiesTrait.php 11Hubspot/../SyncCrmEntitiesTrait.php 939DeleteObjectsTrait.php 12Delerevo ectstraltone 104AccountControllerTest.php 12AccountControllerlest.ono 106Saccount = SaccountRepositorv->findWithtrashedSaccountd:if (Saccount !== null && Saccount->trashed@) ‹Sloader->info(this->aetloaPrefixo.innortunitv has a soft delleted account. Mellete the Accounti.'onnontunitvl => Sthis->idlD):DeleteAccountJob: :dispatch(SaccountId):• Inu 14 May 10.30•20=custom.log=laravel.log4 SF [jiminny@localhost]A HS_local [jiminny@localhost]« console [QAI PROD] XA console (PROD] A console [EU]Tx: AutovfaiminnySELECT * FRoM crm contiqurations WHERE 10 = 95771BoblaSY44SELECT * FROM activities WHERE uuid to_ bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid: # 54963423SELECT * FROM activitiesWHErE vu1d_to_ b1nC'0/258011-25ta-418e-858b-tb21e82b9eaz' = uu1d: # 54965453SELECT * FROM activities WHERE uuid to bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid: # 54963421select * from teams where id = 1031:SELEC * FROM crm confiaurations WHERE 1d = 959-SELECT * FROM activities WHERE uuid to bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid: # 54963517SELECT * EROM activities WHERE uuid to bin(107238011-25fa-4186-838h-£h21e82h9ea20) = uuid• # 54963433SElECT * EPOM activitios WHERE uuid to binc1d6831103-ac34-49hd-hf04-88323a7e53521) = uuid• # 54966000sElEeT + EPOM entivitioc WHEDE mid to hinfi2hdliefoz-hohf-4e97-94e7-0od/he2120991) -nuid.select * from roles:select * from permissions:select * from permission role where permission id = 136:select * from migrations order by id descselect * from teams where id IN (1, 1037)select * from crm lavouts where erm confiquration id = 1,SELECT * FROM crm lavout entities WHERE com lavout id = 1493;SELECT * FROM crm_fields WHERE id IN (1652,1661,66799, 66814, 66821, 66836,66843, 66846, 66864, 84752, 182306,323select * from team features where feature id = 33:sellect * From onnortunities:select * from teams;223 VSELECTu. emarhCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE •• END) AS user_id,sa.*t.owner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idIOTN toame + 1.nc-s1: on + id = u toam idWHERE u.team_id = 1052 and sa.provider = 'hubspot':Onen recults in now tabOnen in Sind WindowW Windsurf Teams 21:23 (16 chars) UTF-8 f 4 space:...
|
NULL
|
-4817518328037884943
|
NULL
|
click
|
ocr
|
NULL
|
codeFV faVsco.js#12066 on JY-20725-handle-HS-searc codeFV faVsco.js#12066 on JY-20725-handle-HS-search-rate-limit kroledeyD CrmT DeleteCrmentity Irai.ong© DeleteAccountJob.php X© DetachActivityObject.phpv D Deletes:ohp• DeleteAccountJodC) DelerecontactJob.declarelscrict-cypes=1)u Deletecrmenutyirac) DelereLeaaJob.ononamespace Jiminny Jobs Crm Delete:© DeleteOpportunity-C) VeritvActivityermi› use ...>W Hubspot>W Salestorceclass DeleteaccountJob extends Job 1mplements Shouldoueuel(C) AutoloaDelavedToermC) CheckAndRetrvRemotiuse "spatchable:c) createFollowuoActivituse InteractsWithQuevec) createNotes.onouse Queveable(C) MatchActivitiesToNewuse Deletecrmentitvirait:(C) MatchActivitvCrmDatal(E) [EMAIL]) SaveActivitv.oholusageprivate const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;© SaveTranscription.php© SetupLayout.php© SyncActivity.php© SyncFieldMetadata.phpublic function __construct(private readonly int $id)f...}public function handled© SyncHubspotObjects.rAccountRepository $accountRepository,syncleaas.ongActivityRepository $activityRepository.© SyncObjects.phpuisparcher sarspaucher© SyncOpportunitiesJobLoggerinterrace slogger,© SyncOpportunity.php© SyncProfileMetadata.rconneccion sab© SyncTeamFieldsJob.pl 104C SyncTeamMetadata.pl 105 G*(c) UpdateOpportunityspprotected function getLogPrefix0: string{...}c) Updatestage.pho110 6tprotected function getEntityType(): Crm0biectf...}> C DealRisks— Mallbox→ → Meetina3o1Midd leware(C) HandleHubsootRateLirC) RateLimited.ohoStreaminalTeamM TelenhonvMuser© ChangeEmailJob.php@ Deactivatellser.loh.nh(C) DeleteScheduledUlser/(C) SetunDefaultSavedSe:C SvncTolntercom.nhn© SyncToPlanhat.php© SyncToUserPilot.php© BaseProcessingJob.php(e) Nummy lnh nhnl©PlaybackController.php©) SendReportJob.phpRematchActivityOnCrmObjectDetach.php© MatchActivityCrmData.php© Client.phpOhuospotraginatlonservice.pnghandlenuospotkateLlmit.onpFind in Files 42 matches in 15 tilles• DeleteAccountJobIn Project ModuleDirectory ScopeDeleteAccountJob:disoatch/saccountld)se Jiminny\Jobs|Crm \Delete DeleteAccountJobDeleteAccountJob::dispatch(Saccount->getld()ise Jiminny\Jobs\Crm\Delete DeleteAccountJobDeleteAccountJob::dispatch(Saccount->getld()):class DeleteAccountJob extends Job implements ShouldQueueuse Jiminny\Jobs\Crm\Delete\DeleteAccountJobAccount::class => new DeleteAccountJob(Smodelld),use Jiminny\Jobs\Crm\Delete\DeleteAccountJobDeleteAccountJob::dispatch(Sid)->afterCommit())use Jiminny|Jobs\Crm\Delete DeleteAccountJobSentity instanceof Account => DeleteAccountJob::dispatch(Sentity->getld().use Jiminny| Jobs\Crm\Delete DeleteAccountJobQueue::assertPushed(DeleteAccountJob::class, function (Siob) use (Saccountld)DeleteOpportunitv.Job.phv app/Jobs/Crm/Deleteprivate function handleSoftDeletedAccount(Opportunity SopportunityAccountkepos1tory saccountkepos1tory.LoggerInterface $logger): void {saccountld = sopportunity->qetaccountidoif (SaccountId === null) {File mask: *-phpX5 Cc W *DeleteOpportunityJob.php 138AccountController.php 10AccountController.ohn 78ContactController.php 11ContactController.nho 86DeleteAccountJob.php 21RemoteCrmRecordDeletedListener.php 13RemoteCrmRecordDeletedListener.pnp 103Hubspot/../SyncCrmEntitiesTrait.php 11Hubspot/../SyncCrmEntitiesTrait.php 939DeleteObjectsTrait.php 12Delerevo ectstraltone 104AccountControllerTest.php 12AccountControllerlest.ono 106Saccount = SaccountRepositorv->findWithtrashedSaccountd:if (Saccount !== null && Saccount->trashed@) ‹Sloader->info(this->aetloaPrefixo.innortunitv has a soft delleted account. Mellete the Accounti.'onnontunitvl => Sthis->idlD):DeleteAccountJob: :dispatch(SaccountId):• Inu 14 May 10.30•20=custom.log=laravel.log4 SF [jiminny@localhost]A HS_local [jiminny@localhost]« console [QAI PROD] XA console (PROD] A console [EU]Tx: AutovfaiminnySELECT * FRoM crm contiqurations WHERE 10 = 95771BoblaSY44SELECT * FROM activities WHERE uuid to_ bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid: # 54963423SELECT * FROM activitiesWHErE vu1d_to_ b1nC'0/258011-25ta-418e-858b-tb21e82b9eaz' = uu1d: # 54965453SELECT * FROM activities WHERE uuid to bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid: # 54963421select * from teams where id = 1031:SELEC * FROM crm confiaurations WHERE 1d = 959-SELECT * FROM activities WHERE uuid to bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid: # 54963517SELECT * EROM activities WHERE uuid to bin(107238011-25fa-4186-838h-£h21e82h9ea20) = uuid• # 54963433SElECT * EPOM activitios WHERE uuid to binc1d6831103-ac34-49hd-hf04-88323a7e53521) = uuid• # 54966000sElEeT + EPOM entivitioc WHEDE mid to hinfi2hdliefoz-hohf-4e97-94e7-0od/he2120991) -nuid.select * from roles:select * from permissions:select * from permission role where permission id = 136:select * from migrations order by id descselect * from teams where id IN (1, 1037)select * from crm lavouts where erm confiquration id = 1,SELECT * FROM crm lavout entities WHERE com lavout id = 1493;SELECT * FROM crm_fields WHERE id IN (1652,1661,66799, 66814, 66821, 66836,66843, 66846, 66864, 84752, 182306,323select * from team features where feature id = 33:sellect * From onnortunities:select * from teams;223 VSELECTu. emarhCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE •• END) AS user_id,sa.*t.owner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idIOTN toame + 1.nc-s1: on + id = u toam idWHERE u.team_id = 1052 and sa.provider = 'hubspot':Onen recults in now tabOnen in Sind WindowW Windsurf Teams 21:23 (16 chars) UTF-8 f 4 space:...
|
44146
|
NULL
|
NULL
|
NULL
|
|
44148
|
1603
|
19
|
2026-05-14T13:36:27.097442+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778765787097_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteAccountJob.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
PostmanFileEditViewWindowHelphhlX Hubspot vQ Searc PostmanFileEditViewWindowHelphhlX Hubspot vQ SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaboration.ET next •POST Re: •POST Re: •GET Rei •GET Read CGET http:IteratiorPOST searcD IteratiorGET get l •GET Re: •POST filte •=+ ...Iteration run Search HS (#15)V COLLECTIONS› Associations> Associations V4> CMS - URL Redirects API Collection› Companies› COMPARE› Contacts> CRM Objects› CRM Owners> CRM Pipelines› Deals› Engagements› Hubspot› Iteration run HSv Iteration run Search HSPOST search contact by email Copy› Journal & webhoooks v4› OAuth› Properties› RESEARCHSEARCHPOST search contact by phonePOST search contact by emailPOST search meetingsPOST search notes> POST Search calls v3> ENVIRONMENTS› SPECS› FLOWSConnect GitE ConsoleTerminal• Iteration run Search HS - 20 VUs • May 14, 2026 16:34:08 (1 min) - Fixed profileSummaryTestsErrorsTotal requests sent O15,441Requests/second O256.05Avg. response time ©65 msP90 ©78 msP95 ©85 msP99 ©118 msError % ©0.00Failure % ©0.00% 1008060402016:34:1116:34:1716:34:2316:34:2916:34:3516:34:4116:34:4716:34:5316:34:59- Requests/second- Avg. response— Error %Performance details for total durationRequestTotal requestsRequests/sError %Failure %Resp. time (Avg. ms)Min (ms)POST search contact by email...15,441255.[PHONE]50100% CThu 14 May 16:36:26InviteUpgradeCu[ Iteration+No environment vRun AgainSharePeak CPU % ©93.6%Peak Memory % ©18.8 %Filter by requestsAvg. response108 ms300 req/s100250802006015040100205016:35:05Virtual users**•CPU %•*• Memory %Max (ms)235P9078.••Globals VaultTools...
|
NULL
|
5273068131404716309
|
NULL
|
click
|
ocr
|
NULL
|
PostmanFileEditViewWindowHelphhlX Hubspot vQ Searc PostmanFileEditViewWindowHelphhlX Hubspot vQ SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaboration.ET next •POST Re: •POST Re: •GET Rei •GET Read CGET http:IteratiorPOST searcD IteratiorGET get l •GET Re: •POST filte •=+ ...Iteration run Search HS (#15)V COLLECTIONS› Associations> Associations V4> CMS - URL Redirects API Collection› Companies› COMPARE› Contacts> CRM Objects› CRM Owners> CRM Pipelines› Deals› Engagements› Hubspot› Iteration run HSv Iteration run Search HSPOST search contact by email Copy› Journal & webhoooks v4› OAuth› Properties› RESEARCHSEARCHPOST search contact by phonePOST search contact by emailPOST search meetingsPOST search notes> POST Search calls v3> ENVIRONMENTS› SPECS› FLOWSConnect GitE ConsoleTerminal• Iteration run Search HS - 20 VUs • May 14, 2026 16:34:08 (1 min) - Fixed profileSummaryTestsErrorsTotal requests sent O15,441Requests/second O256.05Avg. response time ©65 msP90 ©78 msP95 ©85 msP99 ©118 msError % ©0.00Failure % ©0.00% 1008060402016:34:1116:34:1716:34:2316:34:2916:34:3516:34:4116:34:4716:34:5316:34:59- Requests/second- Avg. response— Error %Performance details for total durationRequestTotal requestsRequests/sError %Failure %Resp. time (Avg. ms)Min (ms)POST search contact by email...15,441255.[PHONE]50100% CThu 14 May 16:36:26InviteUpgradeCu[ Iteration+No environment vRun AgainSharePeak CPU % ©93.6%Peak Memory % ©18.8 %Filter by requestsAvg. response108 ms300 req/s100250802006015040100205016:35:05Virtual users**•CPU %•*• Memory %Max (ms)235P9078.••Globals VaultTools...
|
44147
|
NULL
|
NULL
|
NULL
|
|
44145
|
1604
|
14
|
2026-05-14T13:36:06.171004+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778765766171_m2.jpg...
|
PhpStorm
|
faVsco.js – DeleteAccountJob.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Enums\CrmObject;
use Jiminny\Jobs\Job;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Repositories\Crm\AccountRepository;
use Psr\Log\LoggerInterface;
use Throwable;
class DeleteAccountJob extends Job implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use DeleteCrmEntityTrait;
private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;
public function __construct(private readonly int $id)
{
$this->onQueue(Constants::QUEUE_CRM_SYNC);
}
public function handle(
AccountRepository $accountRepository,
ActivityRepository $activityRepository,
Dispatcher $dispatcher,
LoggerInterface $logger,
Connection $db
): void {
try {
$account = $accountRepository->findWithTrashed($this->id);
if ($account === null || ! $account->trashed()) {
$logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [
'account' => $this->id,
'crm_provider_id' => $account?->getCrmProviderId(),
]);
return;
}
$db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {
$activities = $activityRepository->getAccountActivities($account);
$this->handleActivities($activities, $dispatcher, $logger);
// Nullify one-to-many relationships
$accountRepository->nullifyContactReferences($account);
// Check if opportunities exist before deletion
if ($accountRepository->hasOpportunities($account)) {
$logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [
'account' => $this->id,
'opportunity_count' => $accountRepository->countOpportunities($account),
]);
return;
}
// Delete dependent records
$logger->info($this->getLogPrefix() . ' Delete data', [
'account' => $this->id,
'data' => $account->data()->get()->toArray(),
]);
$account->data()->delete();
$logger->info($this->getLogPrefix() . ' Delete subscriptions', [
'account' => $this->id,
'subscriptions' => $account->subscriptions()->get()->toArray(),
]);
$account->subscriptions()->delete();
// Update conversion references
$accountRepository->nullifyLeadConversionReferences($this->id);
$logger->info($this->getLogPrefix() . ' Delete account', [
'account' => $this->id,
'account_object' => $account->toArray(),
]);
$account->forceDelete();
});
} catch (Throwable $e) {
$logger->error($this->getLogPrefix() . ' Account deletion failed', [
'account' => $this->id,
'attempt' => $this->attempts(),
'error' => $e->getMessage(),
]);
throw $e;
}
}
protected function getLogPrefix(): string
{
return '[Delete] [Account]';
}
protected function getEntityType(): CrmObject
{
return self::ENTITY_TYPE;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.122340426,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.82413566,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8394282,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.66788566,"top":0.10055866,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.6775266,"top":0.09896249,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.68484044,"top":0.09896249,"width":0.006981383,"height":0.018355945},"on_screen":true,"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\\Crm\\Delete;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Repositories\\Crm\\AccountRepository;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass DeleteAccountJob extends Job implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n use DeleteCrmEntityTrait;\n\n private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;\n\n public function __construct(private readonly int $id)\n {\n $this->onQueue(Constants::QUEUE_CRM_SYNC);\n }\n\n public function handle(\n AccountRepository $accountRepository,\n ActivityRepository $activityRepository,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n Connection $db\n ): void {\n try {\n $account = $accountRepository->findWithTrashed($this->id);\n\n if ($account === null || ! $account->trashed()) {\n $logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [\n 'account' => $this->id,\n 'crm_provider_id' => $account?->getCrmProviderId(),\n ]);\n\n return;\n }\n\n $db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {\n $activities = $activityRepository->getAccountActivities($account);\n $this->handleActivities($activities, $dispatcher, $logger);\n\n // Nullify one-to-many relationships\n $accountRepository->nullifyContactReferences($account);\n\n // Check if opportunities exist before deletion\n if ($accountRepository->hasOpportunities($account)) {\n $logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [\n 'account' => $this->id,\n 'opportunity_count' => $accountRepository->countOpportunities($account),\n ]);\n\n return;\n }\n\n // Delete dependent records\n $logger->info($this->getLogPrefix() . ' Delete data', [\n 'account' => $this->id,\n 'data' => $account->data()->get()->toArray(),\n ]);\n $account->data()->delete();\n\n $logger->info($this->getLogPrefix() . ' Delete subscriptions', [\n 'account' => $this->id,\n 'subscriptions' => $account->subscriptions()->get()->toArray(),\n ]);\n $account->subscriptions()->delete();\n\n // Update conversion references\n $accountRepository->nullifyLeadConversionReferences($this->id);\n\n $logger->info($this->getLogPrefix() . ' Delete account', [\n 'account' => $this->id,\n 'account_object' => $account->toArray(),\n ]);\n $account->forceDelete();\n });\n\n } catch (Throwable $e) {\n $logger->error($this->getLogPrefix() . ' Account deletion failed', [\n 'account' => $this->id,\n 'attempt' => $this->attempts(),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n }\n\n protected function getLogPrefix(): string\n {\n return '[Delete] [Account]';\n }\n\n protected function getEntityType(): CrmObject\n {\n return self::ENTITY_TYPE;\n }\n}","depth":4,"bounds":{"left":0.12765957,"top":0.09736632,"width":0.56416225,"height":0.8818835},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Repositories\\Crm\\AccountRepository;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass DeleteAccountJob extends Job implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n use DeleteCrmEntityTrait;\n\n private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;\n\n public function __construct(private readonly int $id)\n {\n $this->onQueue(Constants::QUEUE_CRM_SYNC);\n }\n\n public function handle(\n AccountRepository $accountRepository,\n ActivityRepository $activityRepository,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n Connection $db\n ): void {\n try {\n $account = $accountRepository->findWithTrashed($this->id);\n\n if ($account === null || ! $account->trashed()) {\n $logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [\n 'account' => $this->id,\n 'crm_provider_id' => $account?->getCrmProviderId(),\n ]);\n\n return;\n }\n\n $db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {\n $activities = $activityRepository->getAccountActivities($account);\n $this->handleActivities($activities, $dispatcher, $logger);\n\n // Nullify one-to-many relationships\n $accountRepository->nullifyContactReferences($account);\n\n // Check if opportunities exist before deletion\n if ($accountRepository->hasOpportunities($account)) {\n $logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [\n 'account' => $this->id,\n 'opportunity_count' => $accountRepository->countOpportunities($account),\n ]);\n\n return;\n }\n\n // Delete dependent records\n $logger->info($this->getLogPrefix() . ' Delete data', [\n 'account' => $this->id,\n 'data' => $account->data()->get()->toArray(),\n ]);\n $account->data()->delete();\n\n $logger->info($this->getLogPrefix() . ' Delete subscriptions', [\n 'account' => $this->id,\n 'subscriptions' => $account->subscriptions()->get()->toArray(),\n ]);\n $account->subscriptions()->delete();\n\n // Update conversion references\n $accountRepository->nullifyLeadConversionReferences($this->id);\n\n $logger->info($this->getLogPrefix() . ' Delete account', [\n 'account' => $this->id,\n 'account_object' => $account->toArray(),\n ]);\n $account->forceDelete();\n });\n\n } catch (Throwable $e) {\n $logger->error($this->getLogPrefix() . ' Account deletion failed', [\n 'account' => $this->id,\n 'attempt' => $this->attempts(),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n }\n\n protected function getLogPrefix(): string\n {\n return '[Delete] [Account]';\n }\n\n protected function getEntityType(): CrmObject\n {\n return self::ENTITY_TYPE;\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.69348407,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.70212764,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.7130984,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.72174203,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.73038566,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.7413564,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.75232714,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"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.77892286,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.7898936,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"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.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.93517286,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.94514626,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.9544548,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9644282,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9740692,"top":0.12210695,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.12210695,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3453605086229467958
|
6686328802887799389
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Enums\CrmObject;
use Jiminny\Jobs\Job;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Repositories\Crm\AccountRepository;
use Psr\Log\LoggerInterface;
use Throwable;
class DeleteAccountJob extends Job implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use DeleteCrmEntityTrait;
private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;
public function __construct(private readonly int $id)
{
$this->onQueue(Constants::QUEUE_CRM_SYNC);
}
public function handle(
AccountRepository $accountRepository,
ActivityRepository $activityRepository,
Dispatcher $dispatcher,
LoggerInterface $logger,
Connection $db
): void {
try {
$account = $accountRepository->findWithTrashed($this->id);
if ($account === null || ! $account->trashed()) {
$logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [
'account' => $this->id,
'crm_provider_id' => $account?->getCrmProviderId(),
]);
return;
}
$db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {
$activities = $activityRepository->getAccountActivities($account);
$this->handleActivities($activities, $dispatcher, $logger);
// Nullify one-to-many relationships
$accountRepository->nullifyContactReferences($account);
// Check if opportunities exist before deletion
if ($accountRepository->hasOpportunities($account)) {
$logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [
'account' => $this->id,
'opportunity_count' => $accountRepository->countOpportunities($account),
]);
return;
}
// Delete dependent records
$logger->info($this->getLogPrefix() . ' Delete data', [
'account' => $this->id,
'data' => $account->data()->get()->toArray(),
]);
$account->data()->delete();
$logger->info($this->getLogPrefix() . ' Delete subscriptions', [
'account' => $this->id,
'subscriptions' => $account->subscriptions()->get()->toArray(),
]);
$account->subscriptions()->delete();
// Update conversion references
$accountRepository->nullifyLeadConversionReferences($this->id);
$logger->info($this->getLogPrefix() . ' Delete account', [
'account' => $this->id,
'account_object' => $account->toArray(),
]);
$account->forceDelete();
});
} catch (Throwable $e) {
$logger->error($this->getLogPrefix() . ' Account deletion failed', [
'account' => $this->id,
'attempt' => $this->attempts(),
'error' => $e->getMessage(),
]);
throw $e;
}
}
protected function getLogPrefix(): string
{
return '[Delete] [Account]';
}
protected function getEntityType(): CrmObject
{
return self::ENTITY_TYPE;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
44142
|
NULL
|
NULL
|
NULL
|
|
44144
|
1603
|
17
|
2026-05-14T13:36:06.136840+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778765766136_m1.jpg...
|
PhpStorm
|
faVsco.js – DeleteAccountJob.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Enums\CrmObject;
use Jiminny\Jobs\Job;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Repositories\Crm\AccountRepository;
use Psr\Log\LoggerInterface;
use Throwable;
class DeleteAccountJob extends Job implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use DeleteCrmEntityTrait;
private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;
public function __construct(private readonly int $id)
{
$this->onQueue(Constants::QUEUE_CRM_SYNC);
}
public function handle(
AccountRepository $accountRepository,
ActivityRepository $activityRepository,
Dispatcher $dispatcher,
LoggerInterface $logger,
Connection $db
): void {
try {
$account = $accountRepository->findWithTrashed($this->id);
if ($account === null || ! $account->trashed()) {
$logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [
'account' => $this->id,
'crm_provider_id' => $account?->getCrmProviderId(),
]);
return;
}
$db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {
$activities = $activityRepository->getAccountActivities($account);
$this->handleActivities($activities, $dispatcher, $logger);
// Nullify one-to-many relationships
$accountRepository->nullifyContactReferences($account);
// Check if opportunities exist before deletion
if ($accountRepository->hasOpportunities($account)) {
$logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [
'account' => $this->id,
'opportunity_count' => $accountRepository->countOpportunities($account),
]);
return;
}
// Delete dependent records
$logger->info($this->getLogPrefix() . ' Delete data', [
'account' => $this->id,
'data' => $account->data()->get()->toArray(),
]);
$account->data()->delete();
$logger->info($this->getLogPrefix() . ' Delete subscriptions', [
'account' => $this->id,
'subscriptions' => $account->subscriptions()->get()->toArray(),
]);
$account->subscriptions()->delete();
// Update conversion references
$accountRepository->nullifyLeadConversionReferences($this->id);
$logger->info($this->getLogPrefix() . ' Delete account', [
'account' => $this->id,
'account_object' => $account->toArray(),
]);
$account->forceDelete();
});
} catch (Throwable $e) {
$logger->error($this->getLogPrefix() . ' Account deletion failed', [
'account' => $this->id,
'attempt' => $this->attempts(),
'error' => $e->getMessage(),
]);
throw $e;
}
}
protected function getLogPrefix(): string
{
return '[Delete] [Account]';
}
protected function getEntityType(): CrmObject
{
return self::ENTITY_TYPE;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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\\Crm\\Delete;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Repositories\\Crm\\AccountRepository;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass DeleteAccountJob extends Job implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n use DeleteCrmEntityTrait;\n\n private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;\n\n public function __construct(private readonly int $id)\n {\n $this->onQueue(Constants::QUEUE_CRM_SYNC);\n }\n\n public function handle(\n AccountRepository $accountRepository,\n ActivityRepository $activityRepository,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n Connection $db\n ): void {\n try {\n $account = $accountRepository->findWithTrashed($this->id);\n\n if ($account === null || ! $account->trashed()) {\n $logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [\n 'account' => $this->id,\n 'crm_provider_id' => $account?->getCrmProviderId(),\n ]);\n\n return;\n }\n\n $db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {\n $activities = $activityRepository->getAccountActivities($account);\n $this->handleActivities($activities, $dispatcher, $logger);\n\n // Nullify one-to-many relationships\n $accountRepository->nullifyContactReferences($account);\n\n // Check if opportunities exist before deletion\n if ($accountRepository->hasOpportunities($account)) {\n $logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [\n 'account' => $this->id,\n 'opportunity_count' => $accountRepository->countOpportunities($account),\n ]);\n\n return;\n }\n\n // Delete dependent records\n $logger->info($this->getLogPrefix() . ' Delete data', [\n 'account' => $this->id,\n 'data' => $account->data()->get()->toArray(),\n ]);\n $account->data()->delete();\n\n $logger->info($this->getLogPrefix() . ' Delete subscriptions', [\n 'account' => $this->id,\n 'subscriptions' => $account->subscriptions()->get()->toArray(),\n ]);\n $account->subscriptions()->delete();\n\n // Update conversion references\n $accountRepository->nullifyLeadConversionReferences($this->id);\n\n $logger->info($this->getLogPrefix() . ' Delete account', [\n 'account' => $this->id,\n 'account_object' => $account->toArray(),\n ]);\n $account->forceDelete();\n });\n\n } catch (Throwable $e) {\n $logger->error($this->getLogPrefix() . ' Account deletion failed', [\n 'account' => $this->id,\n 'attempt' => $this->attempts(),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n }\n\n protected function getLogPrefix(): string\n {\n return '[Delete] [Account]';\n }\n\n protected function getEntityType(): CrmObject\n {\n return self::ENTITY_TYPE;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Jobs\\Crm\\Delete;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Database\\Connection;\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Foundation\\Bus\\Dispatchable;\nuse Illuminate\\Queue\\InteractsWithQueue;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Enums\\CrmObject;\nuse Jiminny\\Jobs\\Job;\nuse Jiminny\\Repositories\\ActivityRepository;\nuse Jiminny\\Repositories\\Crm\\AccountRepository;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass DeleteAccountJob extends Job implements ShouldQueue\n{\n use Dispatchable;\n use InteractsWithQueue;\n use Queueable;\n use DeleteCrmEntityTrait;\n\n private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;\n\n public function __construct(private readonly int $id)\n {\n $this->onQueue(Constants::QUEUE_CRM_SYNC);\n }\n\n public function handle(\n AccountRepository $accountRepository,\n ActivityRepository $activityRepository,\n Dispatcher $dispatcher,\n LoggerInterface $logger,\n Connection $db\n ): void {\n try {\n $account = $accountRepository->findWithTrashed($this->id);\n\n if ($account === null || ! $account->trashed()) {\n $logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [\n 'account' => $this->id,\n 'crm_provider_id' => $account?->getCrmProviderId(),\n ]);\n\n return;\n }\n\n $db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {\n $activities = $activityRepository->getAccountActivities($account);\n $this->handleActivities($activities, $dispatcher, $logger);\n\n // Nullify one-to-many relationships\n $accountRepository->nullifyContactReferences($account);\n\n // Check if opportunities exist before deletion\n if ($accountRepository->hasOpportunities($account)) {\n $logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [\n 'account' => $this->id,\n 'opportunity_count' => $accountRepository->countOpportunities($account),\n ]);\n\n return;\n }\n\n // Delete dependent records\n $logger->info($this->getLogPrefix() . ' Delete data', [\n 'account' => $this->id,\n 'data' => $account->data()->get()->toArray(),\n ]);\n $account->data()->delete();\n\n $logger->info($this->getLogPrefix() . ' Delete subscriptions', [\n 'account' => $this->id,\n 'subscriptions' => $account->subscriptions()->get()->toArray(),\n ]);\n $account->subscriptions()->delete();\n\n // Update conversion references\n $accountRepository->nullifyLeadConversionReferences($this->id);\n\n $logger->info($this->getLogPrefix() . ' Delete account', [\n 'account' => $this->id,\n 'account_object' => $account->toArray(),\n ]);\n $account->forceDelete();\n });\n\n } catch (Throwable $e) {\n $logger->error($this->getLogPrefix() . ' Account deletion failed', [\n 'account' => $this->id,\n 'attempt' => $this->attempts(),\n 'error' => $e->getMessage(),\n ]);\n\n throw $e;\n }\n }\n\n protected function getLogPrefix(): string\n {\n return '[Delete] [Account]';\n }\n\n protected function getEntityType(): CrmObject\n {\n return self::ENTITY_TYPE;\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3453605086229467958
|
6686328802887799389
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
3
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Jobs\Crm\Delete;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Connection;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Jiminny\Component\Queue\Constants;
use Jiminny\Enums\CrmObject;
use Jiminny\Jobs\Job;
use Jiminny\Repositories\ActivityRepository;
use Jiminny\Repositories\Crm\AccountRepository;
use Psr\Log\LoggerInterface;
use Throwable;
class DeleteAccountJob extends Job implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use DeleteCrmEntityTrait;
private const CrmObject ENTITY_TYPE = CrmObject::ACCOUNT;
public function __construct(private readonly int $id)
{
$this->onQueue(Constants::QUEUE_CRM_SYNC);
}
public function handle(
AccountRepository $accountRepository,
ActivityRepository $activityRepository,
Dispatcher $dispatcher,
LoggerInterface $logger,
Connection $db
): void {
try {
$account = $accountRepository->findWithTrashed($this->id);
if ($account === null || ! $account->trashed()) {
$logger->info($this->getLogPrefix() . ' Account not found or not soft deleted.', [
'account' => $this->id,
'crm_provider_id' => $account?->getCrmProviderId(),
]);
return;
}
$db->transaction(function () use ($account, $accountRepository, $activityRepository, $dispatcher, $logger): void {
$activities = $activityRepository->getAccountActivities($account);
$this->handleActivities($activities, $dispatcher, $logger);
// Nullify one-to-many relationships
$accountRepository->nullifyContactReferences($account);
// Check if opportunities exist before deletion
if ($accountRepository->hasOpportunities($account)) {
$logger->info($this->getLogPrefix() . ' Skipping deletion - account has opportunities', [
'account' => $this->id,
'opportunity_count' => $accountRepository->countOpportunities($account),
]);
return;
}
// Delete dependent records
$logger->info($this->getLogPrefix() . ' Delete data', [
'account' => $this->id,
'data' => $account->data()->get()->toArray(),
]);
$account->data()->delete();
$logger->info($this->getLogPrefix() . ' Delete subscriptions', [
'account' => $this->id,
'subscriptions' => $account->subscriptions()->get()->toArray(),
]);
$account->subscriptions()->delete();
// Update conversion references
$accountRepository->nullifyLeadConversionReferences($this->id);
$logger->info($this->getLogPrefix() . ' Delete account', [
'account' => $this->id,
'account_object' => $account->toArray(),
]);
$account->forceDelete();
});
} catch (Throwable $e) {
$logger->error($this->getLogPrefix() . ' Account deletion failed', [
'account' => $this->id,
'attempt' => $this->attempts(),
'error' => $e->getMessage(),
]);
throw $e;
}
}
protected function getLogPrefix(): string
{
return '[Delete] [Account]';
}
protected function getEntityType(): CrmObject
{
return self::ENTITY_TYPE;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
44143
|
NULL
|
NULL
|
NULL
|
|
45462
|
1628
|
8
|
2026-05-14T14:38:34.742566+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769514742_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIđ 0Pmv Q SearchDate ModifiedYesterdav at 13.39Yesterday at 13:39Yesterday at 13.38Yesterdav at 13:37Yesterday at 13:37resterday at 15:30Yesterdav at 13:36Yesterday at 13:35Yesterday at 13.34Yecterdav at 13:34resterday at 15.3sYesterdav at 13:37Yesterday at 13:32Yesterday at 13:31Yesterday at 13:31Yesterday at 13:30resterday at 13.4yYesterdav at 13:29Yesterday at 13:28Testerady dl 15.40Yesterday at 13:27Yesterday at 13:27Yesterday at 13.26Yesterdav at 13:25Yesterdav at 13:25Yesterday at 13:24Yesterday at 13:23Yesterday at 13.21Yecterdav at 12:21Yesterdav at 13:20Yesterday at 13:20Yesterday at 13:19Yesterday at 13:18Yactordav at 12:17Yesterday at 13:16Yecterdav at 12:16Yesterday at 13:15Yesterday at 13:14Yoctordau at 12:11Yesterday at 13.13Yecterdav at 12:12Yesterdav at 13:12Yesterdav at 13:1143 K:MPEG-4 movie50 KB100 KB88 Kb62 KB71 KB23 KB9 K:MPEG-4 movieMPEG-4 movieMPEG-4 movieMPEO"4 movieMPEG-4 movie13 KBMDSG-A movie16 KE1/ K8MPEG-4 movie29 KBMPEG-A movid12 KB9 KEMPEG"4 movieMPEG-4 movie7 KBMPEG-4 movie8 KB37 K:MPEG-4 movie10 KRI7 KBO KbMPEG-1 movieMPEG-4 movie9 KEMPEG-4 movie8 KB MPEG-4 movie72 KB14 KB|MPEG-4 movie13 KBMDEC.A movic18 KBMPEG-4 movie12 KE10 KBMPEG-4 movieMPEG-4 movie16 KBMPEG-4 movie16 K:MPEG-4 movieMDEC A movid12 KB23 KBMPEG-4 movieЯ KP6 KB6 KBMDEG-A movie11 KBI11 KB20 KB34 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie10KR7 KB5 KBMDSG-A moviaMPEG-4 movie11 KRIMPSG-A movie26 KB MPEG-4 movie111 KB102 KB1g9 kpMPEG-4 movieMDEG.A movio59 KB98 KBMPEG-4 movie07 KрMDEG-A movie66 KBMPEG-4 movie44 KB03 K8MPEG-4 movieAl Notes: OffLeaveFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc toldeLocations0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zipreport(2).xmlAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfKoválik Family Tree.gedbitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esv1 config.vmlIteration run Search HS.postman_collection.jsonm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•AlfredwPmazanoko.imnaoc.YWIfана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentPDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archive5KRMarkdo…..umentWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.45 GB availabold• Inu 14 May 1/•30.34Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
NULL
|
8342324305069557853
|
NULL
|
click
|
ocr
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIđ 0Pmv Q SearchDate ModifiedYesterdav at 13.39Yesterday at 13:39Yesterday at 13.38Yesterdav at 13:37Yesterday at 13:37resterday at 15:30Yesterdav at 13:36Yesterday at 13:35Yesterday at 13.34Yecterdav at 13:34resterday at 15.3sYesterdav at 13:37Yesterday at 13:32Yesterday at 13:31Yesterday at 13:31Yesterday at 13:30resterday at 13.4yYesterdav at 13:29Yesterday at 13:28Testerady dl 15.40Yesterday at 13:27Yesterday at 13:27Yesterday at 13.26Yesterdav at 13:25Yesterdav at 13:25Yesterday at 13:24Yesterday at 13:23Yesterday at 13.21Yecterdav at 12:21Yesterdav at 13:20Yesterday at 13:20Yesterday at 13:19Yesterday at 13:18Yactordav at 12:17Yesterday at 13:16Yecterdav at 12:16Yesterday at 13:15Yesterday at 13:14Yoctordau at 12:11Yesterday at 13.13Yecterdav at 12:12Yesterdav at 13:12Yesterdav at 13:1143 K:MPEG-4 movie50 KB100 KB88 Kb62 KB71 KB23 KB9 K:MPEG-4 movieMPEG-4 movieMPEG-4 movieMPEO"4 movieMPEG-4 movie13 KBMDSG-A movie16 KE1/ K8MPEG-4 movie29 KBMPEG-A movid12 KB9 KEMPEG"4 movieMPEG-4 movie7 KBMPEG-4 movie8 KB37 K:MPEG-4 movie10 KRI7 KBO KbMPEG-1 movieMPEG-4 movie9 KEMPEG-4 movie8 KB MPEG-4 movie72 KB14 KB|MPEG-4 movie13 KBMDEC.A movic18 KBMPEG-4 movie12 KE10 KBMPEG-4 movieMPEG-4 movie16 KBMPEG-4 movie16 K:MPEG-4 movieMDEC A movid12 KB23 KBMPEG-4 movieЯ KP6 KB6 KBMDEG-A movie11 KBI11 KB20 KB34 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie10KR7 KB5 KBMDSG-A moviaMPEG-4 movie11 KRIMPSG-A movie26 KB MPEG-4 movie111 KB102 KB1g9 kpMPEG-4 movieMDEG.A movio59 KB98 KBMPEG-4 movie07 KрMDEG-A movie66 KBMPEG-4 movie44 KB03 K8MPEG-4 movieAl Notes: OffLeaveFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc toldeLocations0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zipreport(2).xmlAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfKoválik Family Tree.gedbitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esv1 config.vmlIteration run Search HS.postman_collection.jsonm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•AlfredwPmazanoko.imnaoc.YWIfана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentPDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archive5KRMarkdo…..umentWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.45 GB availabold• Inu 14 May 1/•30.34Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45461
|
1627
|
9
|
2026-05-14T14:38:37.911194+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769517911_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.054166667,"top":0.027777778,"width":0.08055556,"height":0.035555556},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.13472222,"top":0.027777778,"width":0.25555557,"height":0.035555556},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.6326389,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.6645833,"top":0.027777778,"width":0.15902779,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.82361114,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.8472222,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.87083334,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9291667,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9527778,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9763889,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.73333335,"top":0.3122222,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.75277776,"top":0.3122222,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"15","depth":4,"bounds":{"left":0.7736111,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"bounds":{"left":0.79791665,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.8215278,"top":0.31,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.8368056,"top":0.31,"width":0.014583333,"height":0.025555555},"on_screen":true,"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;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\n }\n}","depth":4,"bounds":{"left":0.26597223,"top":0.21111111,"width":0.6548611,"height":0.7888889},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\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.85486114,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"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.87291664,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.9138889,"top":0.31,"width":0.059027776,"height":0.026666667},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.8645833,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.8854167,"top":0.34444445,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.9048611,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.92569447,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9458333,"top":0.3422222,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.9611111,"top":0.3422222,"width":0.014583333,"height":0.025555555},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.025,"top":0.06666667,"width":0.050694443,"height":0.034444444},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6902378850207333842
|
9001456016336028185
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45460
|
1627
|
8
|
2026-05-14T14:38:34.747494+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769514747_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelplhlFV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTest100% <8• Thu 14 May 17:38:34* :QProject vAutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.php© UserAutomatedReportsController.php:=custom.log+ SyncCrmEntitiesTrait.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpDeleteCrmEntityTrait.phpDeleteAccountJob.phpT SyncFieldsTrait.php+ WriteCrmTrait.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php x© Salesforce/Service.phpT LogActivityTrait.php> D Utils© Playbook.php© Pipedrive/Service.phpClose/Service.phpCopper/Service.php© BullhornService.phpD WebhookT ActivityPlaybookTrait.php18.••© BatchSyncCollector.php© BatchSyncRedisService.php© DetachActivityObject.php© Client.php© ClosedDealStagesService.php© PlainTextDecorateActivity.php-env© HubspotPaginationService.php© HandleHubspotRateLimit.php5namespace Jiminny (Services\Crm Hubspot;© CrmHelperRepository.phpAccountController.php=.env.stagingRematchActivityOnCrmObjectDetach.php© MatchActivityCrmData.phpClient.php01 A2 A15 X12 ^G DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314classDecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatoi© ResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManager.|© WebhookSyncBatchProcessolv D IntegrationApp• AccessorsD ApiD ConfigDDTOD Filters→ Jobs• ProspectSearchStrategy• ServiceTraits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?string{if ($activity->hasTitle()) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO)) {Stitle =Sactivity->getActivityType() ->getName();Cascade & TlCommand 81} else {$title = 'Conference Call':return $title;}-public function convertMeetingOutcome(Activity Sactivity): ?stringf...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchlnterface.php55DamntaCaornhnhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]DGo jiminny084143 ×4 л215•m_layout_id =2162,1661,66799,662172181 219id = 33;1 22281— 221|-222=223— 224|id THEN '(own225226_227228229230hubspot':-=231— 232233V= 11512582;_234-W Windsurf Teams22:48 (15 chars)UTF-8Ca 4 spaces...
|
NULL
|
-1163304622492390733
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelplhlFV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTest100% <8• Thu 14 May 17:38:34* :QProject vAutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.php© UserAutomatedReportsController.php:=custom.log+ SyncCrmEntitiesTrait.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpDeleteCrmEntityTrait.phpDeleteAccountJob.phpT SyncFieldsTrait.php+ WriteCrmTrait.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php x© Salesforce/Service.phpT LogActivityTrait.php> D Utils© Playbook.php© Pipedrive/Service.phpClose/Service.phpCopper/Service.php© BullhornService.phpD WebhookT ActivityPlaybookTrait.php18.••© BatchSyncCollector.php© BatchSyncRedisService.php© DetachActivityObject.php© Client.php© ClosedDealStagesService.php© PlainTextDecorateActivity.php-env© HubspotPaginationService.php© HandleHubspotRateLimit.php5namespace Jiminny (Services\Crm Hubspot;© CrmHelperRepository.phpAccountController.php=.env.stagingRematchActivityOnCrmObjectDetach.php© MatchActivityCrmData.phpClient.php01 A2 A15 X12 ^G DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314classDecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatoi© ResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManager.|© WebhookSyncBatchProcessolv D IntegrationApp• AccessorsD ApiD ConfigDDTOD Filters→ Jobs• ProspectSearchStrategy• ServiceTraits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?string{if ($activity->hasTitle()) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO)) {Stitle =Sactivity->getActivityType() ->getName();Cascade & TlCommand 81} else {$title = 'Conference Call':return $title;}-public function convertMeetingOutcome(Activity Sactivity): ?stringf...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchlnterface.php55DamntaCaornhnhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]DGo jiminny084143 ×4 л215•m_layout_id =2162,1661,66799,662172181 219id = 33;1 22281— 221|-222=223— 224|id THEN '(own225226_227228229230hubspot':-=231— 232233V= 11512582;_234-W Windsurf Teams22:48 (15 chars)UTF-8Ca 4 spaces...
|
45457
|
NULL
|
NULL
|
NULL
|
|
45459
|
1628
|
7
|
2026-05-14T14:38:06.971488+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769486971_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.2962101,"top":1.0,"width":0.03856383,"height":-0.019952059},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.33477393,"top":1.0,"width":0.122340426,"height":-0.019952059},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.5731383,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.5884308,"top":1.0,"width":0.076130316,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.66456115,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.67586434,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.6871675,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.7150931,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.72639626,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.73769945,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"15","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.28224733,"top":1.0,"width":0.024268618,"height":-0.04788506},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6902378850207333842
|
9001456016336028185
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
45458
|
NULL
|
NULL
|
NULL
|
|
45458
|
1628
|
6
|
2026-05-14T14:38:03.998118+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769483998_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.2962101,"top":1.0,"width":0.03856383,"height":-0.019952059},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.33477393,"top":1.0,"width":0.122340426,"height":-0.019952059},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.5731383,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.5884308,"top":1.0,"width":0.076130316,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.66456115,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.67586434,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.6871675,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1234920426369963436
|
-7196396190330140245
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preview insackt[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIđ 0Pmv Q SearchDate ModifiedYesterdav at 13.38Yesterday at 13:38Yesterday at 13.3/Yesterdav at 13:36Yesterday at 13:36resterday at 15.3oYesterdav at 13:39Yesterday at 13:34Yesterday at 13.33Yesterdav at 13:33resterday at 15.32Yesterdav at 13:31Yesterday at 13:30Yesterday at 13:30Yesterday at 13:29resterday at 13.2oYesterdav at 13:28Yesterday at 13:27Yesterday at 13:27Yesterday at 13:26Yesterday at 13:26Yesterday at 13.25Yesterdav at 13:24Yesterdav at 13:24Yesterday at 13:23Yesterday at 13.20Yecterdav at 12:20Yesterdav at 13:19Yesterday at 13.19Yesterdav at 13:18Yesterday at 13:18Yesterday at 13:17Yactordav at 12:16Yesterdav at 13:16Yesterday at 13.1Yecterdav at 12:15Yesterday at 13:14Yesterday at 13:13Yoctorday at 12:12Yesterdav at 13:12Yesterday at 13.12Yesterdav at 13:10v Size100 K:MPEG-4 movie88 KB62 KB/1 Kb23 KB9 KB13 KB16 K:MPEG-4 movieMPEG-4 movieMPEG-4 movieMPEO"4 movie17 KB29 KBMDSG-A movieMP2G-4 movie12 KBMPFG-A movieI KD8 KEMPEG"4 movieMPEG-4 movie37 KBMPEG-4 movie10 KB7K:MPEG-4 movie8 KRI9 KB8 KBMPEG-1 movieMPEG-4 movie72 KEMPEG-4 movie14 KB13 KBMPEG-4 movie9 KBIMPEG-4 movie19 KPMDEC.A movic10 KBMPEG-4 movie16 KEMPEG-4 movie6 KBMPEG-4 movie6 KBMPEG-4 movie12 K:23 KBMDEC A movid6KBMPEG-4 movieAKP11 KB11 KBMDEG-A movie20 K:34 KB10 KB7 KBMPEG-4 movieMDEC.A movialMPEG-4 movieMDSG-A movie11 KB26 KBMPEG-4 movie111 KBIMPSG-A movie102 KB MPEG-4 movie88 KB59 KB09 kpMPEG-4 movieMDEG.A movio97 KB66 KBMPEG-4 movieAAKPMDEG-A movie93 KBMPEG-4 movie78 KB50 K8MPEG-4 movieAl Notes: OffLeaveFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc tolde0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zipreport(2).xmlAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfKoválik Family Tree.gedbitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esviconfig.vmlIteration run Search HS.postman_collection.jsonm licence bettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•AlfredwPmazanoko.imnaoc.YWIfана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentPDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archive5KRMarkdo…..umentWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.46 GB availabld• Inu 14 May 1/.30.0.Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45457
|
1627
|
7
|
2026-05-14T14:38:05.590243+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769485590_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.054166667,"top":0.027777778,"width":0.08055556,"height":0.035555556},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.13472222,"top":0.027777778,"width":0.25555557,"height":0.035555556},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.6326389,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.6645833,"top":0.027777778,"width":0.15902779,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.82361114,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.8472222,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.87083334,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9291667,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9527778,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9763889,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.73333335,"top":0.3122222,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.75277776,"top":0.3122222,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"15","depth":4,"bounds":{"left":0.7736111,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"bounds":{"left":0.79791665,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.8215278,"top":0.31,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.8368056,"top":0.31,"width":0.014583333,"height":0.025555555},"on_screen":true,"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;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\n }\n}","depth":4,"bounds":{"left":0.26666668,"top":0.21111111,"width":0.6548611,"height":0.7888889},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\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.85486114,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"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.87291664,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.9138889,"top":0.31,"width":0.059027776,"height":0.026666667},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.8645833,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.8854167,"top":0.34444445,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.9048611,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.92569447,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9458333,"top":0.3422222,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.9611111,"top":0.3422222,"width":0.014583333,"height":0.025555555},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.025,"top":0.06666667,"width":0.050694443,"height":0.034444444},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6902378850207333842
|
9001456016336028185
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45456
|
1627
|
6
|
2026-05-14T14:38:03.983210+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769483983_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.054166667,"top":0.027777778,"width":0.08055556,"height":0.035555556},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.13472222,"top":0.027777778,"width":0.25555557,"height":0.035555556},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.6326389,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.6645833,"top":0.027777778,"width":0.15902779,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.82361114,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.8472222,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5840353787124240911
|
-7195274138713911831
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelplhlFV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit K vHandleHubspotRateLimitTestv100% C8• Thu 14 May 17:38:03* :QProject vAutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.php© UserAutomatedReportsController.php:=custom.log+ SyncCrmEntitiesTrait.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpDeleteCrmEntityTrait.phpDeleteAccountJob.phpT SyncFieldsTrait.php+ WriteCrmTrait.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php x© Salesforce/Service.phpT LogActivityTrait.php> D Utils© Playbook.php© Pipedrive/Service.phpClose/Service.phpCopper/Service.php© BullhornService.phpD WebhookT ActivityPlaybookTrait.php18.••© BatchSyncCollector.php© BatchSyncRedisService.php© DetachActivityObject.php© Client.php© ClosedDealStagesService.php© PlainTextDecorateActivity.php-env© HubspotPaginationService.phpHandleHubspotRateLimit.php5namespace Jiminny (Services\Crm Hubspot;© CrmHelperRepository.phpAccountController.php=.env.stagingRematchActivityOnCrmObjectDetach.php© MatchActivityCrmData.phpClient.php01 A2 A15 X12 ^G DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314classDecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatoi© ResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManager.|© WebhookSyncBatchProcessolv D IntegrationApp• AccessorsD ApiD ConfigDDTOD Filters→ Jobs• ProspectSearchStrategy• ServiceTraits© DataClient.php15 C1617 ©181920|2122232425262728293045public const string JIMINNX_MARKER = 'Jiminny Summary:' ;public function generateTitle(Activity $activity): ?stringif ($activity->hasTitle()) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO)) {$title = $activity->getActivityType() ->getName();} else {$title = 'Conference Call':return $title;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchlnterface.php55DamntaCaornhnhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D68 jiminny084143 ×4 ^215•m_layout_id =2162,1661,66799,662172181 219id = 33;122281— 221|222=223— 224|id THEN •(own225226_227228229230hubspot':=231— 232-233V= 11512582;_234W Windsurf Teams17:21UTF-8Ca 4 spaces...
|
45453
|
NULL
|
NULL
|
NULL
|
|
45267
|
1623
|
13
|
2026-05-14T14:27:58.752613+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768878752_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLara PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% (C47#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :8• Thu 14 May 17:27:58QProjectv© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny|Services\Crm\Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C1819202122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?string{if ($activity->hasTitleO)) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO)) {$title = $activity->getActivityType() ->getName();} else {$title = 'Conference Call':return $title;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.php55A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)W Windsurf Teams=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D211212213214I215— 216-—217-218-— 219220221222— 223224225226— 227228— 229|_230231232233 V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;1.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivities20:37UTF-8Co 4 spaces...
|
NULL
|
-3547744504747755740
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLara PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% (C47#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :8• Thu 14 May 17:27:58QProjectv© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny|Services\Crm\Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C1819202122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?string{if ($activity->hasTitleO)) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO)) {$title = $activity->getActivityType() ->getName();} else {$title = 'Conference Call':return $title;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.php55A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)W Windsurf Teams=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D211212213214I215— 216-—217-218-— 219220221222— 223224225226— 227228— 229|_230231232233 V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;1.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivities20:37UTF-8Co 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45266
|
1624
|
10
|
2026-05-14T14:27:57.176559+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768877176_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIAl Notes: OffLeavev Q SearchDate ModifiedYesterday at 13.34Yesterday at 13:34Yesterday at 13.33Yesterdav at 13:32resterday al i5.sYesterdav at 13:31Yesterday at 13:30Yesterday at 13.29Yesterdav at 13:29resterday at 15.2oYesterday at 13:27Yesterday at 13:26Yesterday at 13:26Yesterdav at 13:25Yesterday at 13.24Yesterdav at 13:24Yesterday at 13:23Yesterday at 13:21Voctorday at 12:21Yesterday at 13.20Yesterdav at 13:19Yesterdav at 13:19Yesterday at 13:18Yesterday at 13:18Yesterday at 13:17Yesterday at 13.16Yecterdav at 12:16Yesterdav at 13:15Yesterday at 13.10Yesterdav at 13:14Yesterday at 13:14Yesterday at 13:13Yecterdav at 12:12Yesterday at 13.11Yesterdav at 13:11Yesterday at 13:10Yesterday at 13:09Yoctorday at 12:00Yesterdav at 13:08Yesterday at 13.08Yecterdav at 12:07Yesterday at 13:07Yesterdav at 13:0617K:MPEG-4 movie29 KB6 KB12 Kb9 KBI7 KB8 KB37 K:MDEG-A movieMPEG-4 movieMPEG-4 movieMPEG-4 movie10 KB7 KBMDEG-A movieMPEG-4 movie9 KBI8 KB72 KB14 K:MPEG-4 movieMPEG-4 movie13 KBMDECA mavile9 KB18 KB|MPEG-4 movie12 KBI10 KB16 KBMPEG-1 movidMPEG-4 movie6KEMPEG-4 movie6 KB MPEG-4 movie12 KB23 K:MPEG-4 movie8 KB6 KBMDSG.A movicMPEG-4 movie11 KE11 KBMPEG-4 movieMPEG-4 movie20 KB34 K:MPEG-4 movie10kр7 KB5KBMDEG.A movidMPEG-4 movie11 KPMDEG-A movie26 KB MPEG-4 movie111 KBMPEG-4 movie102 K:88 KB59 KB98 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie07 KPMDEG-A movie66 KBMPEG-4 movie44 KBMPEG-4 movie03 K:IMPEG-A movid78 KB MPEG-4 movie50 KB58 KB27 KPMPEG-4 movieMDEG.A movio7 KB12 KBMPEG-4 movie22 K:17 KBMDEC A movid19 KB32 K8MPEG-4 movieFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc tolde0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zip• repon 4).XmAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfP Kdf-a,k Ffmiv Tree.sebitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esviconfig.vmlIteration run Search HS.postman_collection.json--report(1).csvm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•Alfredv P1 mazanoko imaaoc. VWI6ана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentK:PDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archiveMarkdo…..ument5KRWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.55 GB availabld• Inu 14 May 1/.2/:06Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
NULL
|
4406730710463997191
|
NULL
|
click
|
ocr
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIAl Notes: OffLeavev Q SearchDate ModifiedYesterday at 13.34Yesterday at 13:34Yesterday at 13.33Yesterdav at 13:32resterday al i5.sYesterdav at 13:31Yesterday at 13:30Yesterday at 13.29Yesterdav at 13:29resterday at 15.2oYesterday at 13:27Yesterday at 13:26Yesterday at 13:26Yesterdav at 13:25Yesterday at 13.24Yesterdav at 13:24Yesterday at 13:23Yesterday at 13:21Voctorday at 12:21Yesterday at 13.20Yesterdav at 13:19Yesterdav at 13:19Yesterday at 13:18Yesterday at 13:18Yesterday at 13:17Yesterday at 13.16Yecterdav at 12:16Yesterdav at 13:15Yesterday at 13.10Yesterdav at 13:14Yesterday at 13:14Yesterday at 13:13Yecterdav at 12:12Yesterday at 13.11Yesterdav at 13:11Yesterday at 13:10Yesterday at 13:09Yoctorday at 12:00Yesterdav at 13:08Yesterday at 13.08Yecterdav at 12:07Yesterday at 13:07Yesterdav at 13:0617K:MPEG-4 movie29 KB6 KB12 Kb9 KBI7 KB8 KB37 K:MDEG-A movieMPEG-4 movieMPEG-4 movieMPEG-4 movie10 KB7 KBMDEG-A movieMPEG-4 movie9 KBI8 KB72 KB14 K:MPEG-4 movieMPEG-4 movie13 KBMDECA mavile9 KB18 KB|MPEG-4 movie12 KBI10 KB16 KBMPEG-1 movidMPEG-4 movie6KEMPEG-4 movie6 KB MPEG-4 movie12 KB23 K:MPEG-4 movie8 KB6 KBMDSG.A movicMPEG-4 movie11 KE11 KBMPEG-4 movieMPEG-4 movie20 KB34 K:MPEG-4 movie10kр7 KB5KBMDEG.A movidMPEG-4 movie11 KPMDEG-A movie26 KB MPEG-4 movie111 KBMPEG-4 movie102 K:88 KB59 KB98 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie07 KPMDEG-A movie66 KBMPEG-4 movie44 KBMPEG-4 movie03 K:IMPEG-A movid78 KB MPEG-4 movie50 KB58 KB27 KPMPEG-4 movieMDEG.A movio7 KB12 KBMPEG-4 movie22 K:17 KBMDEC A movid19 KB32 K8MPEG-4 movieFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc tolde0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zip• repon 4).XmAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfP Kdf-a,k Ffmiv Tree.sebitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esviconfig.vmlIteration run Search HS.postman_collection.json--report(1).csvm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•Alfredv P1 mazanoko imaaoc. VWI6ана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentK:PDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archiveMarkdo…..ument5KRWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.55 GB availabld• Inu 14 May 1/.2/:06Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
45263
|
NULL
|
NULL
|
NULL
|
|
45265
|
1623
|
12
|
2026-05-14T14:27:57.220305+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768877220_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLara PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% (C47#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :Projectv8• Thu 14 May 17:27:57Q© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny|Services\Crm\Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?stringif ($activity->hasTitleO) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO)) {$title = $activity->getActivityType()->getName();} else {$title = 'Conference Call':return $title;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.phpD2112122132147215216— 217-218-— 219220221222— 223|224225226— 227228— 229_230231232233 V23455A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)W Windsurf Teams=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;1.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivities17:21UTF-8Co 4 spaces...
|
NULL
|
8019392810880732668
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLara PhpStormFileEdit•FV faVsco.jsvViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% (C47#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :Projectv8• Thu 14 May 17:27:57Q© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny|Services\Crm\Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?stringif ($activity->hasTitleO) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO)) {$title = $activity->getActivityType()->getName();} else {$title = 'Conference Call':return $title;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.phpD2112122132147215216— 217-218-— 219220221222— 223|224225226— 227228— 229_230231232233 V23455A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)W Windsurf Teams=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;1.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivities17:21UTF-8Co 4 spaces...
|
45264
|
NULL
|
NULL
|
NULL
|
|
45263
|
1624
|
9
|
2026-05-14T14:27:56.239351+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768876239_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.2962101,"top":1.0,"width":0.03856383,"height":-0.019952059},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.33477393,"top":1.0,"width":0.122340426,"height":-0.019952059},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.5731383,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.5884308,"top":1.0,"width":0.076130316,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.66456115,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.67586434,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.6871675,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.7150931,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.72639626,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.73769945,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"15","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.28224733,"top":1.0,"width":0.024268618,"height":-0.04788506},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3720258616318464950
|
9001456016336028185
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45248
|
1624
|
2
|
2026-05-14T14:26:41.849256+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768801849_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.2962101,"top":1.0,"width":0.03856383,"height":-0.019952059},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.33477393,"top":1.0,"width":0.122340426,"height":-0.019952059},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.5731383,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.5884308,"top":1.0,"width":0.076130316,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.66456115,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.67586434,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.6871675,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.7150931,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.72639626,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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.73769945,"top":1.0,"width":0.011303191,"height":-0.019952059},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"15","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.28224733,"top":1.0,"width":0.024268618,"height":-0.04788506},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6902378850207333842
|
9001456016336028185
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
45244
|
NULL
|
NULL
|
NULL
|
|
45247
|
1623
|
2
|
2026-05-14T14:26:40.853785+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768800853_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.054166667,"top":0.027777778,"width":0.08055556,"height":0.035555556},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.13472222,"top":0.027777778,"width":0.25555557,"height":0.035555556},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.6326389,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.6645833,"top":0.027777778,"width":0.15902779,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.82361114,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.8472222,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.87083334,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9291667,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9527778,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9763889,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.73333335,"top":0.3122222,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.75277776,"top":0.3122222,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"15","depth":4,"bounds":{"left":0.7736111,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"bounds":{"left":0.79791665,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.8215278,"top":0.31,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.8368056,"top":0.31,"width":0.014583333,"height":0.025555555},"on_screen":true,"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;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\n }\n}","depth":4,"bounds":{"left":0.26666668,"top":0.21111111,"width":0.6548611,"height":0.7888889},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\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.85486114,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"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.87291664,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.9138889,"top":0.31,"width":0.059027776,"height":0.026666667},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.8645833,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.8854167,"top":0.34444445,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.9048611,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.92569447,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9458333,"top":0.3422222,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.9611111,"top":0.3422222,"width":0.014583333,"height":0.025555555},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.025,"top":0.06666667,"width":0.050694443,"height":0.034444444},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6902378850207333842
|
9001456016336028185
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
45245
|
NULL
|
NULL
|
NULL
|
|
45246
|
1624
|
1
|
2026-05-14T14:26:39.632885+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768799632_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIAl Notes: OffLeavev Q SearchDate ModifiedYesterday at 13.34Yesterday at 13:34Yesterday at 13.33Yesterdav at 13:32resterday al i5.sYesterdav at 13:31Yesterday at 13:30Yesterday at 13.29Yesterdav at 13:29resterday at 15.2oYesterday at 13:27Yesterday at 13:26Yesterday at 13:26Yesterdav at 13:25Yesterday at 13.24Yesterdav at 13:24Yesterday at 13:23Yesterday at 13:21Voctorday at 12:21Yesterday at 13.20Yesterdav at 13:19Yesterdav at 13:19Yesterday at 13:18Yesterday at 13:18Yesterday at 13:17Yesterday at 13.16Yecterdav at 12:16Yesterdav at 13:15Yesterday at 13.10Yesterdav at 13:14Yesterday at 13:14Yesterday at 13:13Yecterdav at 12:12Yesterday at 13.11Yesterdav at 13:11Yesterday at 13:10Yesterday at 13:09Yoctorday at 12:00Yesterdav at 13:08Yesterday at 13.08Yecterdav at 12:07Yesterday at 13:07Yesterdav at 13:0617K:MPEG-4 movie29 KB6 KB12 Kb9 KBI7 KB8 KB37 K:MDEG-A movieMPEG-4 movieMPEG-4 movieMPEG-4 movie10 KB7 KBMDEG-A movieMPEG-4 movie9 KBI8 KB72 KB14 K:MPEG-4 movieMPEG-4 movie13 KBMDECA mavile9 KB18 KB|MPEG-4 movie12 KBI10 KB16 KBMPEG-1 movidMPEG-4 movie6KEMPEG-4 movie6 KB MPEG-4 movie12 KB23 K:MPEG-4 movie8 KB6 KBMDSG.A movicMPEG-4 movie11 KE11 KBMPEG-4 movieMPEG-4 movie20 KB34 K:MPEG-4 movie10kр7 KB5KBMDEG.A movidMPEG-4 movie11 KPMDEG-A movie26 KB MPEG-4 movie111 KBMPEG-4 movie102 K:88 KB59 KB98 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie07 KPMDEG-A movie66 KBMPEG-4 movie44 KBMPEG-4 movie03 K:IMPEG-A movid78 KB MPEG-4 movie50 KB58 KB27 KPMPEG-4 movieMDEG.A movio7 KB12 KBMPEG-4 movie22 K:17 KBMDEC A movid19 KB32 K8MPEG-4 movieFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc tolde0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zip• repon 4).XmAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfP Kdf-a,k Ffmiv Tree.sebitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esviconfig.vmlIteration run Search HS.postman_collection.json--report(1).csvm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•Alfredv P1 mazanoko imaaoc. VWI6ана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentK:PDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archiveMarkdo…..ument5KRWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.55 GB availabld• Inu 14 May 1/-20.34Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
NULL
|
-2886719812693988698
|
NULL
|
click
|
ocr
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIAl Notes: OffLeavev Q SearchDate ModifiedYesterday at 13.34Yesterday at 13:34Yesterday at 13.33Yesterdav at 13:32resterday al i5.sYesterdav at 13:31Yesterday at 13:30Yesterday at 13.29Yesterdav at 13:29resterday at 15.2oYesterday at 13:27Yesterday at 13:26Yesterday at 13:26Yesterdav at 13:25Yesterday at 13.24Yesterdav at 13:24Yesterday at 13:23Yesterday at 13:21Voctorday at 12:21Yesterday at 13.20Yesterdav at 13:19Yesterdav at 13:19Yesterday at 13:18Yesterday at 13:18Yesterday at 13:17Yesterday at 13.16Yecterdav at 12:16Yesterdav at 13:15Yesterday at 13.10Yesterdav at 13:14Yesterday at 13:14Yesterday at 13:13Yecterdav at 12:12Yesterday at 13.11Yesterdav at 13:11Yesterday at 13:10Yesterday at 13:09Yoctorday at 12:00Yesterdav at 13:08Yesterday at 13.08Yecterdav at 12:07Yesterday at 13:07Yesterdav at 13:0617K:MPEG-4 movie29 KB6 KB12 Kb9 KBI7 KB8 KB37 K:MDEG-A movieMPEG-4 movieMPEG-4 movieMPEG-4 movie10 KB7 KBMDEG-A movieMPEG-4 movie9 KBI8 KB72 KB14 K:MPEG-4 movieMPEG-4 movie13 KBMDECA mavile9 KB18 KB|MPEG-4 movie12 KBI10 KB16 KBMPEG-1 movidMPEG-4 movie6KEMPEG-4 movie6 KB MPEG-4 movie12 KB23 K:MPEG-4 movie8 KB6 KBMDSG.A movicMPEG-4 movie11 KE11 KBMPEG-4 movieMPEG-4 movie20 KB34 K:MPEG-4 movie10kр7 KB5KBMDEG.A movidMPEG-4 movie11 KPMDEG-A movie26 KB MPEG-4 movie111 KBMPEG-4 movie102 K:88 KB59 KB98 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie07 KPMDEG-A movie66 KBMPEG-4 movie44 KBMPEG-4 movie03 K:IMPEG-A movid78 KB MPEG-4 movie50 KB58 KB27 KPMPEG-4 movieMDEG.A movio7 KB12 KBMPEG-4 movie22 K:17 KBMDEC A movid19 KB32 K8MPEG-4 movieFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc tolde0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zip• repon 4).XmAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfP Kdf-a,k Ffmiv Tree.sebitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esviconfig.vmlIteration run Search HS.postman_collection.json--report(1).csvm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•Alfredv P1 mazanoko imaaoc. VWI6ана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentK:PDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archiveMarkdo…..ument5KRWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.55 GB availabld• Inu 14 May 1/-20.34Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
45244
|
NULL
|
NULL
|
NULL
|
|
45245
|
1623
|
1
|
2026-05-14T14:26:37.558876+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768797558_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% (C47•FV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :8• Thu 14 May 17:26:37QProjectv© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny \Services\Crm \Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?string{if ($activity->hasTitleO)) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO) {Cascade 28 Cl$title = $activity->getActivityType()->gi} else {Command &81$title = 'Conference Call';return Stitle;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.php55A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D2112122132147215216_217-218-— 219— 220|221222— 223|224225226— 227-228— 229|_230231232233 V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;1.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivitiesW Windsurf Teams21:45 (15 chars)UTF-8Co 4 spaces...
|
NULL
|
-8373771632646672656
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% (C47•FV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :8• Thu 14 May 17:26:37QProjectv© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny \Services\Crm \Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?string{if ($activity->hasTitleO)) {$title = $activity->getTitle();} elseif ($activity->hasActivityTypeO) {Cascade 28 Cl$title = $activity->getActivityType()->gi} else {Command &81$title = 'Conference Call';return Stitle;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.php55A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D2112122132147215216_217-218-— 219— 220|221222— 223|224225226— 227-228— 229|_230231232233 V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;1.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivitiesW Windsurf Teams21:45 (15 chars)UTF-8Co 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45244
|
1624
|
0
|
2026-05-14T14:26:34.821161+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768794821_m2.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIAl Notes: OffLeavev Q SearchDate ModifiedYesterday at 13.34Yesterday at 13:34Yesterday at 13.33Yesterdav at 13:32resterday al i5.sYesterdav at 13:31Yesterday at 13:30Yesterday at 13.29Yesterdav at 13:29resterday at 15.2oYesterday at 13:27Yesterday at 13:26Yesterday at 13:26Yesterdav at 13:25Yesterday at 13.24Yesterdav at 13:24Yesterday at 13:23Yesterday at 13:21Voctorday at 12:21Yesterday at 13.20Yesterdav at 13:19Yesterdav at 13:19Yesterday at 13:18Yesterday at 13:18Yesterday at 13:17Yesterday at 13.16Yecterdav at 12:16Yesterdav at 13:15Yesterday at 13.10Yesterdav at 13:14Yesterday at 13:14Yesterday at 13:13Yecterdav at 12:12Yesterday at 13.11Yesterdav at 13:11Yesterday at 13:10Yesterday at 13:09Yoctorday at 12:00Yesterdav at 13:08Yesterday at 13.08Yecterdav at 12:07Yesterday at 13:07Yesterdav at 13:0617K:MPEG-4 movie29 KB6 KB12 Kb9 KBI7 KB8 KB37 K:MDEG-A movieMPEG-4 movieMPEG-4 movieMPEG-4 movie10 KB7 KBMDEG-A movieMPEG-4 movie9 KBI8 KB72 KB14 K:MPEG-4 movieMPEG-4 movie13 KBMDECA mavile9 KB18 KB|MPEG-4 movie12 KBI10 KB16 KBMPEG-1 movidMPEG-4 movie6KEMPEG-4 movie6 KB MPEG-4 movie12 KB23 K:MPEG-4 movie8 KB6 KBMDSG.A movicMPEG-4 movie11 KE11 KBMPEG-4 movieMPEG-4 movie20 KB34 K:MPEG-4 movie10kр7 KB5KBMDEG.A movidMPEG-4 movie11 KPMDEG-A movie26 KB MPEG-4 movie111 KBMPEG-4 movie102 K:88 KB59 KB98 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie07 KPMDEG-A movie66 KBMPEG-4 movie44 KBMPEG-4 movie03 K:IMPEG-A movid78 KB MPEG-4 movie50 KB58 KB27 KPMPEG-4 movieMDEG.A movio7 KB12 KBMPEG-4 movie22 K:17 KBMDEC A movid19 KB32 K8MPEG-4 movieFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc tolde0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zip• repon 4).XmAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfP Kdf-a,k Ffmiv Tree.sebitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esviconfig.vmlIteration run Search HS.postman_collection.json--report(1).csvm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•Alfredv P1 mazanoko imaaoc. VWI6ана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentK:PDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archiveMarkdo…..ument5KRWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.55 GB availabld• Inu 14 May 1/-20.34Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
NULL
|
-2886719812693988698
|
NULL
|
click
|
ocr
|
NULL
|
Jiminny... ~ActivityFilesLater@ jiminny-x-integrat Jiminny... ~ActivityFilesLater@ jiminny-x-integrati• plattorm-inner-teamE Channels# ai-chapter# alertsi backend# bugscontusion-cllnia# curiosity lab# engineering# general#jiminny-bgac nlattorm-nckets# product launches# random# releases# sofia-officed sunport# thank-yous# the people of iimi... Direct messages• 8la 62% Galya Dimitrovavasil VasilevM Stefka StovanovaSg: Todor StamatovMario GeorgievNiudlay lanay. James Graham "* Stoyan Tanevo Stelivan Georgiev( Petko Kashinski*. Lukas Kovali...::: AnnsToastS lira Gloud6d Huddle with Aneliva Angelova* Aneliya Angelova &• Messagest Add canvasur FilesAneliya Angelova 2:30 PMЛукаш, само при Сейлсфорс и Хубспот се синкваха активити типовете, когато се направи плейбук,нали?пои останалите скМі тоябва оъчно ла се въвелат.Lukas Kovalik 2:47 PMтряова да се за всички, някъде не се ли попьлвапри зохо май беше hardcoded но май и там си връщаха две категорииAneliya Angelova 4:00 PMЛукаш имаш ли време да се чуем за тестването на https://jiminny.atlassian.net/browse/JY-20725X Preuiew in sact[HubSpotl Optimise CRM rematct(7 OpenRosdy for OA- MediumAA Aneliya AngelovaAs of today at 4:00 PM RetreshOpen in Jira* SummariseLukas Kovalik 4:02 PMzean-iurwiniareelYou joined the huddle (LIVE 4:06 PMAneliva Angelova is here toolAneliva Angelova 4:44 PN11512582Lukas Kovalik M 5.16 PNcurl --location "httns:ani.hubani.com/crm/v3/obiects/contacts/search--header 'Content-vne' annlication/ison'--header "Authorization: BearerC|Kvma?iMx7OINOM8kOFwrAowAcAkUAhIR24?A05D?xiVrIYMILuP6SA01Kwcmhr=n.v2 hytorDniMvDalYck-CMalovolNOM9kOFwrAUAcrkcaws-ThwRARIRAOF-ATFSAOFRAO-ROIEBAQUBEggBAQEBAYICFIr7Au8O2Nwal9YW2CbCCxYvwngmSgNldTFSAFoAYABoAHAAeAA'\--data "{ "limit", 13'Message Aneliva Angelova+ AaIAl Notes: OffLeavev Q SearchDate ModifiedYesterday at 13.34Yesterday at 13:34Yesterday at 13.33Yesterdav at 13:32resterday al i5.sYesterdav at 13:31Yesterday at 13:30Yesterday at 13.29Yesterdav at 13:29resterday at 15.2oYesterday at 13:27Yesterday at 13:26Yesterday at 13:26Yesterdav at 13:25Yesterday at 13.24Yesterdav at 13:24Yesterday at 13:23Yesterday at 13:21Voctorday at 12:21Yesterday at 13.20Yesterdav at 13:19Yesterdav at 13:19Yesterday at 13:18Yesterday at 13:18Yesterday at 13:17Yesterday at 13.16Yecterdav at 12:16Yesterdav at 13:15Yesterday at 13.10Yesterdav at 13:14Yesterday at 13:14Yesterday at 13:13Yecterdav at 12:12Yesterday at 13.11Yesterdav at 13:11Yesterday at 13:10Yesterday at 13:09Yoctorday at 12:00Yesterdav at 13:08Yesterday at 13.08Yecterdav at 12:07Yesterday at 13:07Yesterdav at 13:0617K:MPEG-4 movie29 KB6 KB12 Kb9 KBI7 KB8 KB37 K:MDEG-A movieMPEG-4 movieMPEG-4 movieMPEG-4 movie10 KB7 KBMDEG-A movieMPEG-4 movie9 KBI8 KB72 KB14 K:MPEG-4 movieMPEG-4 movie13 KBMDECA mavile9 KB18 KB|MPEG-4 movie12 KBI10 KB16 KBMPEG-1 movidMPEG-4 movie6KEMPEG-4 movie6 KB MPEG-4 movie12 KB23 K:MPEG-4 movie8 KB6 KBMDSG.A movicMPEG-4 movie11 KE11 KBMPEG-4 movieMPEG-4 movie20 KB34 K:MPEG-4 movie10kр7 KB5KBMDEG.A movidMPEG-4 movie11 KPMDEG-A movie26 KB MPEG-4 movie111 KBMPEG-4 movie102 K:88 KB59 KB98 KBMPEG-4 movieMDEC.A moviaMPEG-4 movie07 KPMDEG-A movie66 KBMPEG-4 movie44 KBMPEG-4 movie03 K:IMPEG-A movid78 KB MPEG-4 movie50 KB58 KB27 KPMPEG-4 movieMDEG.A movio7 KB12 KBMPEG-4 movie22 K:17 KBMDEC A movid19 KB32 K8MPEG-4 movieFavourites• jiminny• Recents* ApplicationsiCloud• iCloud Drive992 Svnc tolde0 DXP4800PLUS-B5F49 Networl• CRMI• Orange• Red|• Yellow• Green• Purple•) All lags..IhlDownloadsNameLoom.pkgAlfred copv.alfredoreterences=KeychronAssist-1.0.2 (1).dmeKeychronAssist-1.0.2.dmgmazanoke-images-yWJo.zioPhotos-3-001.zip• Transcript.pd→mage U.loge1 Orioninstaller.dma_image.jpg- image (2).1pc• ПO-22221726037035-004-001_ORGES.pdf%D0%9F%D0%9E-22221726037035-004-001 archive.zipПO-22221726037035-004-001_archive (1).zip• repon 4).XmAltred copy2.altredoreterencesСE 060209С О000000026571172 CWICT 0Р70501260015900 ndt= 27022026_0000000026574472_ SWIFT_ [IBAN].pdf= 03042026 [CREDIT_CARD] SWIFT [CREDIT_CARD].001reportxmmi=pdt.odiB pdf-1.pdfD pdf-2.pdf-pdf-5.pd1= ndf-1 ndipdf-3.pdfP Kdf-a,k Ffmiv Tree.sebitwarden export 20251031122528.isonlKoválik Family Tree.zip*macOS Storage_Cleanup.mdal favicon icofirst aid_notes_complete.docxrenortl2).esviconfig.vmlIteration run Search HS.postman_collection.json--report(1).csvm licence hettertouchtoalMariusHosting Config.isonnokc.901a6502.6667.A62h-062 ccu•Alfredv P1 mazanoko imaaoc. VWI6ана Ковалик.jpg•искане даниел Ковалик..pg• Фактура Март Даниел Ковалик.jрс• Фактура Април Даниел Ковалик iро• Dhotac 2.001Q SearchKind00,4 MD55.9 MBinstdlle..dckageAlfred...ferences10,1 MB10,1 MBIL MBDisk ImageDisk ImageLiP archive6.6 MBZIp archive2,5 MB PDF Document2,5 MBJreo lmage2.2 MBDisk Image2,2 MB PDF Document2 MBJPEG image1,9 MBJPEG imaqe192 KBPDE Document140 KbZIP archive148 KВ148 KB122 KBZIP archivelZIP archiveXML document111 KBAlfred...ferences94 KBDDE Documont92 KBPDr DocumentK:PDF Document91 KB91 KBXML document30 KBn0kpDDE Nocumont28 KBPDF Document28 KRPDE Document28 KB27 KBDocument14 KB11 KB6 KB6KBJSONINCV NacumontZIP archiveMarkdo…..ument5KRWindo...n image4 KB3 KBword ..cumentCSV Document2 KBVAMI dosumon1 KB029 buteccSV Documenthttlicence183 bytesZero butesJSONAlfrod foronso!Zero bytesFolde1.9 MB1,8 MB17 MB1,7 MBColdorJPEG imageJPEG ImageIPEG imadeJPEG imageColdo1 of 58 selected, 8.55 GB availabld• Inu 14 May 1/-20.34Date AddedIs Mdl ZUzo dl 19:4530 Jan 2026 at 12:3617 Mar 2026 at 20:2717 Mar 2026 at 20:26Z3 Aor 2020 al 13:0229 ,Jan 2026 at 15:2019 Dec 2025 at 10:1619 Dec 2025 at 12:238 Aor 2026 at 20:3519 Dec 2025 at 10:2919 Dec 2025 at 12:1819 Dec 2025 at 12:4026 Mar 2026 at 11:2410 May 2026 at 13:5326 Mar 2026 at 11:2426 Mar 2026 at 11:2426 Mar 2026 at 11:2310 May 2026 at 14:3730 Jan 2026 at 12:3712 Goh 2006 9t 11:5 A1Z3 Apr 2026 at 13.0823 Aor 2026 at 13:0810 May 2026 at 13:5410 May 2026 at 14:3710 May 2026 at 13:4910 May 2026 at 13:5010 May 2026 at 13:5110 Mav 2026 at 12:51110 May 2026 at 13:5019 Dec 2025 at 11:3431 Oct 2025 at 12:2525 Nau 2025 4+ 17:506 Mar 2026 at 11.2224 Anr 2026 at 16:5220 Oct 2025 at 11:0218 Mar 2026 at 15:29• Mav 2026 at 11:09129 Oct 2025 at 19:329 May 2026 at 10:0419 Mar 2026 at 11:55|10 May 2026 at 13:5712 Jun 2025 at 19:0430 Jan 2026 at 12:362616 Oct 2025 aт 16:0122 Aar 2026 at 12:0223 Apr 2026 at 13:0223 Apr 2026 at 13:0222 Anr 2026 at 12:0223 Apr 2026 at 13:0229 Jan 2026 at 15:20...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45243
|
1623
|
0
|
2026-05-14T14:26:34.528854+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768794528_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% C•FV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :Projectv8• Thu 14 May 17:26:34Q© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny|Services\Crm\Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> D Api> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?stringif ($activity->hasTitle()) {Stitle =Sactivity->getTitle();} elseif ($activity->hasActivityTypeO)) {$title = $activity->getActivityType()->getName();} else {$title = 'Conference Call':return $title;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.php55A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)W Windsurf Teams=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D2112122132147215216— 217-218-— 219220221222— 223|224225226— 227-228— 229_230231232233 V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivities19:26UTF-8Co 4 spaces...
|
NULL
|
2315866660195442686
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl100% C•FV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv* :Projectv8• Thu 14 May 17:26:34Q© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.phpT WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php=.env.staging18E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© HandleHubspotRateLimit.php© ClosedDealStagesService.ptnamespace Jiminny|Services\Crm\Hubspot;01 A2 A15 X12 ^C DealFieldsService.php© DecorateActivity.phpuse© FieldDefinitions.php© FieldTypeConverter.php© HubspotClientinterface.php121314class DecorateActivity extends BaseDecorateActivity© HubspotTokenManager.php5 usages© PayloadBuilder.php© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> D Api> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy• Service Traits© DataClient.php15 C1617 C181920|2122232425262728293045public const string JIMINNY_MARKER = 'Jiminny Summary:';public function generateTitle(Activity $activity): ?stringif ($activity->hasTitle()) {Stitle =Sactivity->getTitle();} elseif ($activity->hasActivityTypeO)) {$title = $activity->getActivityType()->getName();} else {$title = 'Conference Call':return $title;public function convertMeetingOutcome(Activity Sactivity): ?string{...}© DecorateActivity.php2 usages© LocalSearch.php46public function convertCallStatus(Activity $activity): string{...}© LocalSearchinterface.php55A DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)W Windsurf Teams=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D2112122132147215216— 217-218-— 219220221222— 223|224225226— 227-228— 229_230231232233 V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;.id, CASEWHENidFROMsocial.on u.id= sa.:1..n<->1: on t.L_id = 1052 andIMaccounts wheiactivities19:26UTF-8Co 4 spaces...
|
45241
|
NULL
|
NULL
|
NULL
|
|
45241
|
NULL
|
0
|
2026-05-14T14:26:33.286275+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768793286_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.054166667,"top":0.027777778,"width":0.08055556,"height":0.035555556},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.13472222,"top":0.027777778,"width":0.25555557,"height":0.035555556},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.6326389,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.6645833,"top":0.027777778,"width":0.15902779,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.82361114,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.8472222,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.87083334,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9291667,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9527778,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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.9763889,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.73333335,"top":0.3122222,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.75277776,"top":0.3122222,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"15","depth":4,"bounds":{"left":0.7736111,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"12","depth":4,"bounds":{"left":0.79791665,"top":0.3122222,"width":0.02013889,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.8215278,"top":0.31,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.8368056,"top":0.31,"width":0.014583333,"height":0.025555555},"on_screen":true,"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;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\n }\n}","depth":4,"bounds":{"left":0.26666668,"top":0.21111111,"width":0.6548611,"height":0.7888889},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Crm\\Hubspot;\n\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Models\\Activity;\nuse Jiminny\\Repositories\\ActivityMessageRepository;\nuse Jiminny\\Repositories\\ParticipantRepository;\nuse Jiminny\\Services\\Crm\\DecorateActivity\\BaseDecorateActivity;\n\nclass DecorateActivity extends BaseDecorateActivity\n{\n public const string JIMINNY_MARKER = 'Jiminny Summary:';\n\n public function generateTitle(Activity $activity): ?string\n {\n if ($activity->hasTitle()) {\n $title = $activity->getTitle();\n } elseif ($activity->hasActivityType()) {\n $title = $activity->getActivityType()->getName();\n } else {\n $title = 'Conference Call';\n }\n\n return $title;\n }\n\n public function convertMeetingOutcome(Activity $activity): ?string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_SCHEDULED:\n return 'SCHEDULED';\n case Activity::STATUS_CANCELLED:\n return 'CANCELED';\n case Activity::STATUS_COMPLETED:\n return 'COMPLETED';\n //case Activity::STATUS_NO_SHOW:\n // return 'NO_SHOW';\n default:\n return null;\n }\n }\n\n public function convertCallStatus(Activity $activity): string\n {\n switch ($activity->getStatus()) {\n case Activity::STATUS_NO_ANSWER:\n return 'NO_ANSWER';\n default:\n return 'COMPLETED';\n }\n }\n\n public function generateDescription(Activity $activity): ?string\n {\n if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {\n return $this->formatSmsDescription($activity);\n }\n\n $description = $this->baseDescription();\n\n if ($activity->hasTitle() && $activity->hasActivityType()) {\n $description .= $this->formatActivityType($activity->getActivityType()->getName());\n }\n\n if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {\n $description .= $this->formatSoftphoneDetails($activity);\n }\n\n $description .= $this->formatReasonOrPreview($activity);\n\n if ($activity->isTypeConference()) {\n $description .= $this->formatAttendeesList($activity);\n }\n\n return $description\n . $this->formatNotes($activity)\n . $this->formatMessages($activity)\n . $this->formatSummary($activity);\n }\n\n public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string\n {\n if (empty($existingCrmDescription)) {\n return $jiminnyDescription;\n }\n\n if (! $this->isJiminnyDescription($existingCrmDescription)) {\n return $existingCrmDescription . '<hr>' . $jiminnyDescription;\n }\n\n $existingSections = $this->parseHtmlSections($existingCrmDescription);\n $newSections = $this->parseHtmlSections($jiminnyDescription);\n\n return $this->mergeHtmlSections($newSections, $existingSections);\n }\n\n private function parseHtmlSections(string $html): array\n {\n $sections = [\n 'beforeJiminny' => '',\n 'header' => '',\n ];\n\n foreach (self::SECTION_HEADERS as $name) {\n $sections[$name] = '';\n }\n\n $headerStartPos = $this->findHeaderStartPosition($html);\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n\n if ($headerStartPos !== false && $headerStartPos > 0) {\n $sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));\n }\n\n if ($headerStartPos !== false) {\n $jiminnyStart = $headerStartPos;\n } elseif ($markerPos !== false) {\n $jiminnyStart = $markerPos;\n } else {\n $jiminnyStart = 0;\n }\n\n $firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);\n\n if ($firstSectionPos === false) {\n $sections['header'] = substr($html, $jiminnyStart);\n } else {\n $sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);\n }\n\n $sections['header'] = trim($sections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);\n }\n\n return $sections;\n }\n\n private function findHeaderStartPosition(string $html): int|false\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*<span[^>]*>\\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';\n\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {\n return $matches[0][1];\n }\n\n $markerPos = stripos($html, self::JIMINNY_MARKER);\n if ($markerPos === false) {\n return false;\n }\n\n $beforeMarker = substr($html, 0, $markerPos);\n $lastPTagPos = strrpos($beforeMarker, '<p');\n\n return $lastPTagPos !== false ? $lastPTagPos : $markerPos;\n }\n\n private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false\n {\n $firstPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($firstPos === false || $pos < $firstPos) {\n $firstPos = $pos;\n }\n }\n }\n\n return $firstPos;\n }\n\n private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string\n {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n\n if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n return '';\n }\n\n $headerMatch = $matches[0][0];\n $headerPos = $matches[0][1];\n $contentStart = $headerPos + strlen($headerMatch);\n\n $nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);\n\n if ($nextSectionPos === false) {\n $content = substr($html, $contentStart);\n } else {\n $content = substr($html, $contentStart, $nextSectionPos - $contentStart);\n }\n\n return trim($content);\n }\n\n private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false\n {\n $nextPos = false;\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $pattern = '/<p[^>]*>\\s*<strong[^>]*>\\s*' . preg_quote($sectionName, '/') . '\\s*<\\/strong>\\s*<\\/p>/i';\n if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {\n $pos = $matches[0][1];\n if ($nextPos === false || $pos < $nextPos) {\n $nextPos = $pos;\n }\n }\n }\n\n return $nextPos;\n }\n\n private function mergeHtmlSections(array $newSections, array $existingSections): string\n {\n $result = '';\n\n if (! empty($existingSections['beforeJiminny'])) {\n $result .= $existingSections['beforeJiminny'];\n }\n\n $result .= $this->wrapHeader($newSections['header']);\n\n foreach (self::SECTION_HEADERS as $sectionName) {\n $existingContent = $existingSections[$sectionName] ?? '';\n $newContent = $newSections[$sectionName] ?? '';\n\n $content = ! empty($existingContent) ? $existingContent : $newContent;\n\n if (! empty($content)) {\n $result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;\n }\n }\n\n return $result;\n }\n\n private function wrapHeader(string $header): string\n {\n $header = trim($header);\n\n if (str_starts_with($header, '<p>')) {\n return $header;\n }\n\n if (str_starts_with($header, self::JIMINNY_MARKER)) {\n return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));\n }\n\n return $header;\n }\n\n private function baseDescription(): string\n {\n return sprintf(\n '<p><strong><span style=\"font-size: 15px; line-height: 30px;\">%s</span></strong></p>',\n 'Jiminny Summary:'\n );\n }\n\n private function formatSoftphoneDetails(Activity $activity): string\n {\n $isOutbound = $activity->isTypeSoftPhone();\n $isInbound = $activity->isTypeSoftphoneInbound();\n\n if (! $isOutbound && ! $isInbound) {\n return '';\n }\n\n $output = $this->formatTitle($activity->getTitle());\n $output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));\n\n $phone = $isOutbound\n ? $activity->to?->phone_number\n : $activity->from?->phone_number;\n\n if ($phone) {\n $output .= $isOutbound\n ? $this->formatDialedNumber($phone)\n : $this->formatCallerNumber($phone);\n }\n\n return $output . '<p></p>';\n }\n\n private function formatReasonOrPreview(Activity $activity): string\n {\n if ($activity->hasReasonCodeBotKicked()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker removed from this meeting'\n . '</span></p>';\n }\n\n if ($activity->hasReasonCodeNotCompliant()) {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">'\n . 'Notetaker did not join due to recording consent not being provided by attendees'\n . '</span></p>';\n }\n\n return $this->formatPreviewUrl($activity);\n }\n\n\n public function formatStartTime(Activity $activity): int\n {\n return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatEndTime(Activity $activity): int\n {\n return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCreatedAt(Activity $activity): int\n {\n return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;\n }\n\n public function formatCallToParticipant(Activity $activity): ?string\n {\n $callToParticipant = $activity->getToParticipant()?->getPhoneNumber();\n if ($callToParticipant && $activity->hasContact()) {\n return $activity->getContact()->getName() . ' ' . $callToParticipant;\n }\n\n return null;\n }\n\n private function formatActivityType(string $activityType): string\n {\n return '<p><strong><span style=\"font-size: 18.6667px; line-height: 22.4px;\">' . $activityType . '</span></strong></p>';\n }\n\n private function formatTitle(?string $title): string\n {\n return $title ? '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $title . '</span></p>' : '';\n }\n\n private function formatCallDuration(string $duration): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Call Duration: ' . $duration . '</span></p>';\n }\n\n private function formatDialedNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Dialed: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatCallerNumber(string $phoneNumber): string\n {\n return '<p><span style=\"font-size: 13.3333px; line-height: 16px;\">Caller: ' . $phoneNumber . '</span></p>';\n }\n\n private function formatAttendeesList(Activity $activity): string\n {\n $attendeesList = '<p><strong>Attendees</strong></p><ul>';\n\n $participantsRepository = app(ParticipantRepository::class);\n // Only include participants that joined.\n $participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);\n foreach ($participants as $participant) {\n $attendee = '<li>';\n if ($participant->hasName()) {\n $attendee .= $participant->getName();\n if ($participant->hasPhoneNumber()) {\n $attendee .= ' (' . $participant->getPhoneNumber() . ')';\n } elseif ($participant->hasEmailAddress()) {\n $attendee .= ' (' . $participant->getEmailAddress() . ')';\n }\n } else {\n $attendee .= $participant->getPhoneNumber();\n }\n\n if ($participant->isCoach()) {\n $attendee .= ' <strong>coach</strong>';\n }\n\n if ($participant->getTitle()) {\n $attendee .= ', ' . $participant->getTitle();\n }\n\n $attendeesList .= $attendee . '</li>';\n }\n\n return $attendeesList . '</ul>';\n }\n\n private function formatPreviewUrl(Activity $activity): string\n {\n $description = '';\n $team = $activity->getUser()->getTeam();\n\n if ($activity->canReviewActivity()) {\n $playbackUrl = $team->getPartner()->getPlaybackUrl($activity);\n $description .= '<p><span style=\"font-size: 13.3333px; line-height: 16px;\"><a href=\"'\n . $playbackUrl\n . '\" target=\"_blank\">Review in Jiminny</a> ▶️</span></p>';\n }\n\n return $description;\n }\n\n private function formatNotes(Activity $activity): string\n {\n $description = '';\n if ($activity->getNotes()->isEmpty()) {\n return $description;\n }\n\n $description .= '<p><strong>Notes</strong></p>';\n foreach ($activity->getNotes() as $note) {\n $time = ($note->getTime() > 3600)\n ? gmdate('H:i:s', (int) $note->getTime())\n : gmdate('i:s', (int) $note->getTime());\n\n $description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';\n }\n\n return $description . '</p>';\n }\n\n private function formatMessages(Activity $activity): string\n {\n $description = '';\n $messageRepository = app(ActivityMessageRepository::class);\n\n // Get all private messages.\n $privateMessages = $messageRepository->getPrivateMessages($activity);\n if ($privateMessages->isNotEmpty()) {\n $description .= '<p><strong>Coaching Chat</strong></p>';\n $description .= $this->getMessagesAsString($privateMessages);\n $description .= '</p>';\n }\n\n // Get all public messages\n $publicMessages = $messageRepository->getPublicMessages($activity);\n if ($publicMessages->isNotEmpty()) {\n $description .= '<p><strong>Customer Chat</strong></p>';\n $description .= $this->getMessagesAsString($publicMessages);\n $description .= '</p>';\n }\n\n return $description;\n }\n\n private function getMessagesAsString(Collection $messages): string\n {\n $description = '';\n\n /** @var Activity\\Message $message */\n foreach ($messages as $message) {\n $description .= '<p>' . $message->participant->getName()\n . ': ' . $message->getAttribute('message') . '</p>';\n }\n\n return $description;\n }\n\n private function formatSummary(Activity $activity): string\n {\n $description = '';\n if ($activity->getSummary() !== null) {\n $description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';\n }\n\n return $description;\n }\n\n private function formatSmsDescription(Activity $activity): string\n {\n // Use Rich-text formatting.\n $description = '<p><span style=\"font-size: 16px; line-height: 19.2px;\"><strong>' . $activity->getTitle() . '</strong></span></p>';\n $description .= '<p><span style=\"font-size: 16px; line-height: 19.2px;\">' . $activity->getDescription() . '</span></p>';\n\n return $description;\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.85486114,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"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.87291664,"top":0.31,"width":0.018055556,"height":0.026666667},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.9138889,"top":0.31,"width":0.059027776,"height":0.026666667},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.8645833,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.8854167,"top":0.34444445,"width":0.015277778,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.9048611,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.92569447,"top":0.34444445,"width":0.016666668,"height":0.02111111},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9458333,"top":0.3422222,"width":0.015277778,"height":0.025555555},"on_screen":true,"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.9611111,"top":0.3422222,"width":0.014583333,"height":0.025555555},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","depth":4,"on_screen":true,"value":"SELECT\n# DISTINCT\nopp.id as opp_id, opp.uuid, opp.name,\n# COUNT(dr.id) AS deal_risk_count,\n\n# dr.id,\n# cfd.value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\n# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id\n# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id\n\nLEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 1\nAND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\nGROUP BY opp.id, cfd.value\nORDER BY\n# cfd.value\n CAST(cfd.value AS UNSIGNED)\n# owner_name\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1\n# AND gdrt.is_enabled = 1)\nDESC\nLIMIT 25\n# OFFSET 0\n;\n\nselect * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';\nselect * from crm_layout_entities where crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4584045;\nSELECT * FROM crm_field_data WHERE object_id = 4584045;\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'\n\nSELECT\n opp.id as opportunity_id,\n opp.name,\n COUNT(dr.id) as risk_count\nFROM opportunities opp\nLEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id\nWHERE opp.id IN (\n 6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788\n)\nGROUP BY opp.id;\n\nSELECT COUNT(dr.id)\n FROM deal_risks dr\n JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n WHERE dr.opportunity_id = 5563344\n# AND gdrt.group_id = usr.group_id\n\n\n\nEXPLAIN SELECT\n opp.id as opp_id, opp.uuid, opp.name,\n\ncfd.value,\ncfv.sequence,\ncfv.value,\n# MAX(cfd.value) AS max_cfd_value,\nusr.name AS owner_name,\nopp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,\nusr.uuid as owner_uuid,\nusr.photo_path as owner_photo,\nusr.id AS owner_id,\njt.name as owner_job,\nopp.stage_id, opp.stage_updated_at,\nacc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,\nrt.business_process_id AS pipeline_id\nFROM opportunities opp\n\nLEFT JOIN record_types rt ON opp.record_type_id = rt.id\nLEFT JOIN users usr ON opp.user_id = usr.id\nLEFT JOIN accounts acc ON opp.account_id = acc.id\nLEFT JOIN job_titles jt ON usr.job_title_id = jt.id\n\nLEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id\n FROM crm_field_data sub_cfd\n WHERE sub_cfd.object_id = opp.id\n AND sub_cfd.crm_field_id = 66810\n ORDER BY sub_cfd.updated_at DESC\n LIMIT 1)\n\nLEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value\n\nWHERE opp.user_id IS NOT NULL\nAND opp.deleted_at IS NULL\nAND opp.is_closed = 0\n# AND opp.is_closed = 1\n# AND opp.is_won = 0\nAND opp.close_date >= '2024-01-01 00:00:00'\nAND opp.close_date <= '2024-12-31 23:59:59'\nAND usr.team_id = 1\n\n# and opp.id = 4823179\n\n# GROUP BY opp.id\nORDER BY\n cfv.sequence DESC,\n# opp.name\n# owner_name\n cfd.value\n# CAST(cfd.value AS UNSIGNED)\n# CAST(MAX(cfd.value) AS UNSIGNED)\n# (SELECT COUNT(dr.id)\n# FROM deal_risks dr\n# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id\n# WHERE dr.opportunity_id = opp.id\n# AND dr.is_active = 1 AND gdrt.is_enabled = 1)\nDESC\n# LIMIT 75, 25\n;\n\n\n\nSELECT * FROM crm_field_values WHERE crm_field_id = 66810;\n\nSELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at\nFROM crm_fields f\nINNER JOIN crm_field_data fd ON fd.crm_field_id = f.id\n WHERE (f.crm_configuration_id = 1)\n AND (f.object_type = 'opportunity')\n# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))\n AND (fd.object_id IN (4158460))\n AND (f.crm_provider_id IN ('ForecastCategoryName'))\n ORDER BY fd.object_id ASC, fd.updated_at DESC;\n\nselect * from crm_layouts where crm_configuration_id = 1;\nselect cf.* from crm_fields cf\njoin crm_layout_entities cle on cf.id = cle.crm_field_id\nwhere crm_layout_id = 1493;\n\nSELECT * FROM opportunities WHERE id = 4158460;\nSELECT * FROM crm_field_data WHERE object_id = 4158460;\n\nselect * from users where team_id = 1;\nSELECT * FROM users WHERE id = 7160;\nselect * from role_user where user_id = 3248;\n\nselect * from crm_field_values where crm_field_id = 66824;\n\nSELECT * FROM users WHERE id = 23470;\nselect * from crm_configurations;\n\n# ******************************************\nselect * from teams where id = 1038; # 23521, 966\nselect * from users where team_id = 1038;\nselect * from crm_configurations where id = 966;\nSELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762\nSELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764\nSELECT * FROM participants WHERE activity_id = 54965764;\n\nSELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075\nSELECT * FROM participants WHERE activity_id = 54964075;\nselect f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id\n where tf.team_id = 1038;\n\n\n# ****************************************** PD *************************\nselect * from teams where id = 1029;\nSELECT * FROM crm_configurations WHERE id = 957;\nSELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421\n\n# ****************************************** Close *************************\nselect * from teams where id = 1031;\nSELECT * FROM crm_configurations WHERE id = 959;\nSELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517\n\n\nSELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433\n\nSELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009\n\n# ****************************************** SF *************************\nSELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;\n\nselect * from roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 136;\n\nselect * from migrations order by id desc;\n\nselect * from teams where id IN (1, 1037);\nselect * from crm_layouts where crm_configuration_id = 1;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;\nSELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);\n\nselect * from features;\nselect * from team_features where feature_id = 33;\nselect * from opportunities;\n\nselect * from teams;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nSELECT * FROM accounts where id = 11512582;\nselect * from activities where account_id = 11512582;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.025,"top":0.06666667,"width":0.050694443,"height":0.034444444},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4502170315616947179
|
9001456016336028185
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
2
15
12
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use Illuminate\Support\Collection;
use Jiminny\Models\Activity;
use Jiminny\Repositories\ActivityMessageRepository;
use Jiminny\Repositories\ParticipantRepository;
use Jiminny\Services\Crm\DecorateActivity\BaseDecorateActivity;
class DecorateActivity extends BaseDecorateActivity
{
public const string JIMINNY_MARKER = 'Jiminny Summary:';
public function generateTitle(Activity $activity): ?string
{
if ($activity->hasTitle()) {
$title = $activity->getTitle();
} elseif ($activity->hasActivityType()) {
$title = $activity->getActivityType()->getName();
} else {
$title = 'Conference Call';
}
return $title;
}
public function convertMeetingOutcome(Activity $activity): ?string
{
switch ($activity->getStatus()) {
case Activity::STATUS_SCHEDULED:
return 'SCHEDULED';
case Activity::STATUS_CANCELLED:
return 'CANCELED';
case Activity::STATUS_COMPLETED:
return 'COMPLETED';
//case Activity::STATUS_NO_SHOW:
// return 'NO_SHOW';
default:
return null;
}
}
public function convertCallStatus(Activity $activity): string
{
switch ($activity->getStatus()) {
case Activity::STATUS_NO_ANSWER:
return 'NO_ANSWER';
default:
return 'COMPLETED';
}
}
public function generateDescription(Activity $activity): ?string
{
if (in_array($activity->getType(), [Activity::TYPE_SMS_INBOUND, Activity::TYPE_SMS_OUTBOUND], true)) {
return $this->formatSmsDescription($activity);
}
$description = $this->baseDescription();
if ($activity->hasTitle() && $activity->hasActivityType()) {
$description .= $this->formatActivityType($activity->getActivityType()->getName());
}
if ($activity->getProvider() !== Activity::PROVIDER_UPLOADER) {
$description .= $this->formatSoftphoneDetails($activity);
}
$description .= $this->formatReasonOrPreview($activity);
if ($activity->isTypeConference()) {
$description .= $this->formatAttendeesList($activity);
}
return $description
. $this->formatNotes($activity)
. $this->formatMessages($activity)
. $this->formatSummary($activity);
}
public function mergeDescriptions(string $jiminnyDescription, ?string $existingCrmDescription): string
{
if (empty($existingCrmDescription)) {
return $jiminnyDescription;
}
if (! $this->isJiminnyDescription($existingCrmDescription)) {
return $existingCrmDescription . '<hr>' . $jiminnyDescription;
}
$existingSections = $this->parseHtmlSections($existingCrmDescription);
$newSections = $this->parseHtmlSections($jiminnyDescription);
return $this->mergeHtmlSections($newSections, $existingSections);
}
private function parseHtmlSections(string $html): array
{
$sections = [
'beforeJiminny' => '',
'header' => '',
];
foreach (self::SECTION_HEADERS as $name) {
$sections[$name] = '';
}
$headerStartPos = $this->findHeaderStartPosition($html);
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($headerStartPos !== false && $headerStartPos > 0) {
$sections['beforeJiminny'] = trim(substr($html, 0, $headerStartPos));
}
if ($headerStartPos !== false) {
$jiminnyStart = $headerStartPos;
} elseif ($markerPos !== false) {
$jiminnyStart = $markerPos;
} else {
$jiminnyStart = 0;
}
$firstSectionPos = $this->findFirstHtmlSectionPosition($html, $jiminnyStart);
if ($firstSectionPos === false) {
$sections['header'] = substr($html, $jiminnyStart);
} else {
$sections['header'] = substr($html, $jiminnyStart, $firstSectionPos - $jiminnyStart);
}
$sections['header'] = trim($sections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$sections[$sectionName] = $this->extractHtmlSectionContent($html, $sectionName, $jiminnyStart);
}
return $sections;
}
private function findHeaderStartPosition(string $html): int|false
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*<span[^>]*>\s*' . preg_quote(self::JIMINNY_MARKER, '/') . '/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE)) {
return $matches[0][1];
}
$markerPos = stripos($html, self::JIMINNY_MARKER);
if ($markerPos === false) {
return false;
}
$beforeMarker = substr($html, 0, $markerPos);
$lastPTagPos = strrpos($beforeMarker, '<p');
return $lastPTagPos !== false ? $lastPTagPos : $markerPos;
}
private function findFirstHtmlSectionPosition(string $html, int $afterPosition = 0): int|false
{
$firstPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($firstPos === false || $pos < $firstPos) {
$firstPos = $pos;
}
}
}
return $firstPos;
}
private function extractHtmlSectionContent(string $html, string $sectionName, int $afterPosition = 0): string
{
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (! preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
return '';
}
$headerMatch = $matches[0][0];
$headerPos = $matches[0][1];
$contentStart = $headerPos + strlen($headerMatch);
$nextSectionPos = $this->findNextHtmlSectionPosition($html, $contentStart);
if ($nextSectionPos === false) {
$content = substr($html, $contentStart);
} else {
$content = substr($html, $contentStart, $nextSectionPos - $contentStart);
}
return trim($content);
}
private function findNextHtmlSectionPosition(string $html, int $afterPosition): int|false
{
$nextPos = false;
foreach (self::SECTION_HEADERS as $sectionName) {
$pattern = '/<p[^>]*>\s*<strong[^>]*>\s*' . preg_quote($sectionName, '/') . '\s*<\/strong>\s*<\/p>/i';
if (preg_match($pattern, $html, $matches, PREG_OFFSET_CAPTURE, $afterPosition)) {
$pos = $matches[0][1];
if ($nextPos === false || $pos < $nextPos) {
$nextPos = $pos;
}
}
}
return $nextPos;
}
private function mergeHtmlSections(array $newSections, array $existingSections): string
{
$result = '';
if (! empty($existingSections['beforeJiminny'])) {
$result .= $existingSections['beforeJiminny'];
}
$result .= $this->wrapHeader($newSections['header']);
foreach (self::SECTION_HEADERS as $sectionName) {
$existingContent = $existingSections[$sectionName] ?? '';
$newContent = $newSections[$sectionName] ?? '';
$content = ! empty($existingContent) ? $existingContent : $newContent;
if (! empty($content)) {
$result .= '<p><strong>' . $sectionName . '</strong></p>' . $content;
}
}
return $result;
}
private function wrapHeader(string $header): string
{
$header = trim($header);
if (str_starts_with($header, '<p>')) {
return $header;
}
if (str_starts_with($header, self::JIMINNY_MARKER)) {
return $this->baseDescription() . substr($header, strlen(self::JIMINNY_MARKER));
}
return $header;
}
private function baseDescription(): string
{
return sprintf(
'<p><strong><span style="font-size: 15px; line-height: 30px;">%s</span></strong></p>',
'Jiminny Summary:'
);
}
private function formatSoftphoneDetails(Activity $activity): string
{
$isOutbound = $activity->isTypeSoftPhone();
$isInbound = $activity->isTypeSoftphoneInbound();
if (! $isOutbound && ! $isInbound) {
return '';
}
$output = $this->formatTitle($activity->getTitle());
$output .= $this->formatCallDuration($activity->getAttribute('duration_for_humans'));
$phone = $isOutbound
? $activity->to?->phone_number
: $activity->from?->phone_number;
if ($phone) {
$output .= $isOutbound
? $this->formatDialedNumber($phone)
: $this->formatCallerNumber($phone);
}
return $output . '<p></p>';
}
private function formatReasonOrPreview(Activity $activity): string
{
if ($activity->hasReasonCodeBotKicked()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker removed from this meeting'
. '</span></p>';
}
if ($activity->hasReasonCodeNotCompliant()) {
return '<p><span style="font-size: 13.3333px; line-height: 16px;">'
. 'Notetaker did not join due to recording consent not being provided by attendees'
. '</span></p>';
}
return $this->formatPreviewUrl($activity);
}
public function formatStartTime(Activity $activity): int
{
return $activity->getActualStartTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatEndTime(Activity $activity): int
{
return $activity->getActualEndTime()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCreatedAt(Activity $activity): int
{
return $activity->getCreatedAt()->tz($activity->getUser()->timezone)->getTimestamp() * 1000;
}
public function formatCallToParticipant(Activity $activity): ?string
{
$callToParticipant = $activity->getToParticipant()?->getPhoneNumber();
if ($callToParticipant && $activity->hasContact()) {
return $activity->getContact()->getName() . ' ' . $callToParticipant;
}
return null;
}
private function formatActivityType(string $activityType): string
{
return '<p><strong><span style="font-size: 18.6667px; line-height: 22.4px;">' . $activityType . '</span></strong></p>';
}
private function formatTitle(?string $title): string
{
return $title ? '<p><span style="font-size: 16px; line-height: 19.2px;">' . $title . '</span></p>' : '';
}
private function formatCallDuration(string $duration): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Call Duration: ' . $duration . '</span></p>';
}
private function formatDialedNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Dialed: ' . $phoneNumber . '</span></p>';
}
private function formatCallerNumber(string $phoneNumber): string
{
return '<p><span style="font-size: 13.3333px; line-height: 16px;">Caller: ' . $phoneNumber . '</span></p>';
}
private function formatAttendeesList(Activity $activity): string
{
$attendeesList = '<p><strong>Attendees</strong></p><ul>';
$participantsRepository = app(ParticipantRepository::class);
// Only include participants that joined.
$participants = $participantsRepository->getParticipantsWhoEnteredMeeting($activity);
foreach ($participants as $participant) {
$attendee = '<li>';
if ($participant->hasName()) {
$attendee .= $participant->getName();
if ($participant->hasPhoneNumber()) {
$attendee .= ' (' . $participant->getPhoneNumber() . ')';
} elseif ($participant->hasEmailAddress()) {
$attendee .= ' (' . $participant->getEmailAddress() . ')';
}
} else {
$attendee .= $participant->getPhoneNumber();
}
if ($participant->isCoach()) {
$attendee .= ' <strong>coach</strong>';
}
if ($participant->getTitle()) {
$attendee .= ', ' . $participant->getTitle();
}
$attendeesList .= $attendee . '</li>';
}
return $attendeesList . '</ul>';
}
private function formatPreviewUrl(Activity $activity): string
{
$description = '';
$team = $activity->getUser()->getTeam();
if ($activity->canReviewActivity()) {
$playbackUrl = $team->getPartner()->getPlaybackUrl($activity);
$description .= '<p><span style="font-size: 13.3333px; line-height: 16px;"><a href="'
. $playbackUrl
. '" target="_blank">Review in Jiminny</a> ▶️</span></p>';
}
return $description;
}
private function formatNotes(Activity $activity): string
{
$description = '';
if ($activity->getNotes()->isEmpty()) {
return $description;
}
$description .= '<p><strong>Notes</strong></p>';
foreach ($activity->getNotes() as $note) {
$time = ($note->getTime() > 3600)
? gmdate('H:i:s', (int) $note->getTime())
: gmdate('i:s', (int) $note->getTime());
$description .= '<p>' . $time . ' ' . $note->getNote() . '</p>';
}
return $description . '</p>';
}
private function formatMessages(Activity $activity): string
{
$description = '';
$messageRepository = app(ActivityMessageRepository::class);
// Get all private messages.
$privateMessages = $messageRepository->getPrivateMessages($activity);
if ($privateMessages->isNotEmpty()) {
$description .= '<p><strong>Coaching Chat</strong></p>';
$description .= $this->getMessagesAsString($privateMessages);
$description .= '</p>';
}
// Get all public messages
$publicMessages = $messageRepository->getPublicMessages($activity);
if ($publicMessages->isNotEmpty()) {
$description .= '<p><strong>Customer Chat</strong></p>';
$description .= $this->getMessagesAsString($publicMessages);
$description .= '</p>';
}
return $description;
}
private function getMessagesAsString(Collection $messages): string
{
$description = '';
/** @var Activity\Message $message */
foreach ($messages as $message) {
$description .= '<p>' . $message->participant->getName()
. ': ' . $message->getAttribute('message') . '</p>';
}
return $description;
}
private function formatSummary(Activity $activity): string
{
$description = '';
if ($activity->getSummary() !== null) {
$description .= '<p><strong>Summary</strong></p><p>' . nl2br($activity->getSummary()) . '</p><p></p>';
}
return $description;
}
private function formatSmsDescription(Activity $activity): string
{
// Use Rich-text formatting.
$description = '<p><span style="font-size: 16px; line-height: 19.2px;"><strong>' . $activity->getTitle() . '</strong></span></p>';
$description .= '<p><span style="font-size: 16px; line-height: 19.2px;">' . $activity->getDescription() . '</span></p>';
return $description;
}
}
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
8
1
3
4
Previous Highlighted Error
Next Highlighted Error
SELECT
# DISTINCT
opp.id as opp_id, opp.uuid, opp.name,
# COUNT(dr.id) AS deal_risk_count,
# dr.id,
# cfd.value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
# LEFT JOIN group_deal_risk_types gdrt ON gdrt.group_id = usr.group_id
# LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id AND dr.group_deal_risk_type_id = gdrt.id
LEFT JOIN crm_field_data cfd ON (cfd.object_id = opp.id and cfd.crm_field_id = 66814)
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 1
AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
GROUP BY opp.id, cfd.value
ORDER BY
# cfd.value
CAST(cfd.value AS UNSIGNED)
# owner_name
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1
# AND gdrt.is_enabled = 1)
DESC
LIMIT 25
# OFFSET 0
;
select * from crm_fields where crm_configuration_id = 1 and object_type = 'opportunity';
select * from crm_layout_entities where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4584045;
SELECT * FROM crm_field_data WHERE object_id = 4584045;
SELECT * FROM opportunities where team_id = 1 and crm_provider_id = '0061K00000lfb9IQAQ'
SELECT
opp.id as opportunity_id,
opp.name,
COUNT(dr.id) as risk_count
FROM opportunities opp
LEFT JOIN deal_risks dr ON dr.opportunity_id = opp.id
WHERE opp.id IN (
6069574,8900938,9507638,9524799,9660490,9662824,9705675,9749758,4158460,4391812,6450439,4448422,5118945,5590675,4584045,7228149,9002408,9165534,9446720,9641778,9665149,9703344,9709280,5747948,4158491,6182565,6263970,5798120,5111315,4536978,6062352,6548383,6072095,6548225,4480986,5011422,6548381,8760540,8917554,9509986,9514392,9569009,9569011,9578490,9713604,5784397,7276612,7288405,8994421,9118219,9608148,9818911,4510535,6479693,5958049,6271674,6550448,4158331,4158483,6126571,6171615,6540943,4897466,5190896,5796182,5932762,8572433,8723698,8892697,9711001,9789264,4549188,6100831,6170064,6260799,6263653,6449936,6530871,6538978,7777651,8059269,8319918,8787049,8901150,9263153,9453207,9514738,9696700,9791062,5752018,6421452,7439134,7878923,9354763,9369285,9514396,9582506,9889949,9890216,4094311,4158495,4158496,6098128,5585661,3872564,6442149,5891604,6164746,6199593,6583474,6519684,9018490,9809006,4496897,5041324,5829430,6198319,6253504,6555763,7242914,7931055,8024125,8797814,8058559,8673347,8892695,8994420,9616219,9714970,9722004,9809439,9818918,6523177,8134147,9002915,9711422,9892713,9901719,9954210,9978435,5800810,6243518,6416114,6222251,6411974,6512456,5791953,6545606,9914780,5805540,6238986,6463838,6547680,9767049,9809437,9810885,9890855,6673493,9902036,4335521,6379871,6503799,6546077,8018765,9907556,9958433,9905855,9916179,9946741,9957877,5563344,6271838,6450815,7641128,7762567,7780592,8684810,8685786,8685787,8685788
)
GROUP BY opp.id;
SELECT COUNT(dr.id)
FROM deal_risks dr
JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
WHERE dr.opportunity_id = 5563344
# AND gdrt.group_id = usr.group_id
EXPLAIN SELECT
opp.id as opp_id, opp.uuid, opp.name,
cfd.value,
cfv.sequence,
cfv.value,
# MAX(cfd.value) AS max_cfd_value,
usr.name AS owner_name,
opp.value, opp.currency_code, opp.close_date, opp.remotely_created_at, opp.is_closed, opp.is_won,
usr.uuid as owner_uuid,
usr.photo_path as owner_photo,
usr.id AS owner_id,
jt.name as owner_job,
opp.stage_id, opp.stage_updated_at,
acc.name AS acc_name, opp.stage_updated_at, acc.crm_provider_id AS acc_provider_id, opp.crm_provider_id AS opp_provider_id,
rt.business_process_id AS pipeline_id
FROM opportunities opp
LEFT JOIN record_types rt ON opp.record_type_id = rt.id
LEFT JOIN users usr ON opp.user_id = usr.id
LEFT JOIN accounts acc ON opp.account_id = acc.id
LEFT JOIN job_titles jt ON usr.job_title_id = jt.id
LEFT JOIN crm_field_data cfd ON cfd.id = (SELECT sub_cfd.id
FROM crm_field_data sub_cfd
WHERE sub_cfd.object_id = opp.id
AND sub_cfd.crm_field_id = 66810
ORDER BY sub_cfd.updated_at DESC
LIMIT 1)
LEFT JOIN crm_field_values cfv ON cfv.crm_field_id = 66810 AND cfv.value = cfd.value
WHERE opp.user_id IS NOT NULL
AND opp.deleted_at IS NULL
AND opp.is_closed = 0
# AND opp.is_closed = 1
# AND opp.is_won = 0
AND opp.close_date >= '2024-01-01 00:00:00'
AND opp.close_date <= '2024-12-31 23:59:59'
AND usr.team_id = 1
# and opp.id = 4823179
# GROUP BY opp.id
ORDER BY
cfv.sequence DESC,
# opp.name
# owner_name
cfd.value
# CAST(cfd.value AS UNSIGNED)
# CAST(MAX(cfd.value) AS UNSIGNED)
# (SELECT COUNT(dr.id)
# FROM deal_risks dr
# JOIN group_deal_risk_types gdrt ON dr.group_deal_risk_type_id = gdrt.id
# WHERE dr.opportunity_id = opp.id
# AND dr.is_active = 1 AND gdrt.is_enabled = 1)
DESC
# LIMIT 75, 25
;
SELECT * FROM crm_field_values WHERE crm_field_id = 66810;
SELECT f.id, f.crm_provider_id AS field_name, f.label, fd.object_id AS dealId, fd.value, fd.updated_at, fd.id, fd.created_at
FROM crm_fields f
INNER JOIN crm_field_data fd ON fd.crm_field_id = f.id
WHERE (f.crm_configuration_id = 1)
AND (f.object_type = 'opportunity')
# AND (fd.object_id IN (4158331,4158483,4158495,4158496,6069574,6263970,6171615,6540943,6545606,5829430,6198319,6263653,6548381,7242914,8797814,7228149,7439134,7878923,8134147,9002915,9118219,9165534,9354763,9369285,9446720))
AND (fd.object_id IN (4158460))
AND (f.crm_provider_id IN ('ForecastCategoryName'))
ORDER BY fd.object_id ASC, fd.updated_at DESC;
select * from crm_layouts where crm_configuration_id = 1;
select cf.* from crm_fields cf
join crm_layout_entities cle on cf.id = cle.crm_field_id
where crm_layout_id = 1493;
SELECT * FROM opportunities WHERE id = 4158460;
SELECT * FROM crm_field_data WHERE object_id = 4158460;
select * from users where team_id = 1;
SELECT * FROM users WHERE id = 7160;
select * from role_user where user_id = 3248;
select * from crm_field_values where crm_field_id = 66824;
SELECT * FROM users WHERE id = 23470;
select * from crm_configurations;
# [PASSWORD_DOTS]
select * from teams where id = 1038; # 23521, 966
select * from users where team_id = 1038;
select * from crm_configurations where id = 966;
SELECT * FROM activities WHERE uuid_to_bin('e8dc7c34-31f6-4430-bd81-2d9d8f00dd07') = uuid; # 54965762
SELECT * FROM activities WHERE uuid_to_bin('4b5727c0-69d1-428f-b8d9-b649055166e2') = uuid; # 54965764
SELECT * FROM participants WHERE activity_id = 54965764;
SELECT id, uuid, title, recording_state FROM activities WHERE uuid_to_bin('355f105d-5606-4379-b0c5-d91daf59f4ce') = uuid; # 54964075
SELECT * FROM participants WHERE activity_id = 54964075;
select f.id, slug, title, tf.team_id from team_features tf JOIN features f on tf.feature_id = f.id
where tf.team_id = 1038;
# [PASSWORD_DOTS] PD [PASSWORD_DOTS]
select * from teams where id = 1029;
SELECT * FROM crm_configurations WHERE id = 957;
SELECT * FROM activities WHERE uuid_to_bin('581a33cb-4343-44bd-ac0c-4a5cee71c5ec') = uuid; # 54963423
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('8b6bb2f7-e7a7-4aec-8806-fbfea7093ccd') = uuid; # 54963421
# [PASSWORD_DOTS] Close [PASSWORD_DOTS]
select * from teams where id = 1031;
SELECT * FROM crm_configurations WHERE id = 959;
SELECT * FROM activities WHERE uuid_to_bin('59c517e0-96c9-4dad-bfeb-b7bef72f8725') = uuid; # 54963517
SELECT * FROM activities WHERE uuid_to_bin('07238011-25fa-418e-838b-fb21e82b9ea2') = uuid; # 54963433
SELECT * FROM activities WHERE uuid_to_bin('d68311e3-ac34-49bd-bf04-88323a7e5352') = uuid; # 54966009
# [PASSWORD_DOTS] SF [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('2bd4cfa3-4eb5-4c77-84a7-9ed46a21c988') = uuid;
select * from roles;
select * from permissions;
select * from permission_role where permission_id = 136;
select * from migrations order by id desc;
select * from teams where id IN (1, 1037);
select * from crm_layouts where crm_configuration_id = 1;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 1493;
SELECT * FROM crm_fields WHERE id IN (1652,1661,66799,66814,66821,66836,66843,66846,66864,84752,182306,323580,380378);
select * from features;
select * from team_features where feature_id = 33;
select * from opportunities;
select * from teams;
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 = 1052 and sa.provider = 'hubspot';
SELECT * FROM accounts where id = 11512582;
select * from activities where account_id = 11512582;
Project
Project...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45239
|
1621
|
64
|
2026-05-14T14:26:26.709302+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778768786709_m1.jpg...
|
PhpStorm
|
faVsco.js – DecorateActivity.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelp•FV faVsco.jsv* #12066 on JY-20725-handle-HS-search-rate-limit k vabl100% (<47HandleHubspotRateLimitTestv8• Thu 14 May 17:26:26* :QProjectv© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.php() WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php.env.staging18.••E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© ClosedDealStagesService.pt© HandleHubspotRateLimit.phpUseC DealFieldsService.php712© DecorateActivity.php© FieldDefinitions.php© FieldTypeConverter.php1314class DecorateActivity extends BaseDecorateActivity© HubspotClientinterface.php© HubspotTokenManager.php© PayloadBuilder.php1516public const string JIMINNY_MARKER = 'Jiminny Summary:';© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy17181920|212223242526272829public function generateTitle(Activity $activity): ?stringif ($activity->hasTitleO)) {$title = $activity->getTitle();} elseif (Sactivity->hasActivityType)) {Stitle = Sactivity->getActivityType() ->getName();} else {$title = 'Conference Call';return Stitle;> D ServiceTraits© DataClient.php© DecorateActivity.php3045public function convertMeetingOutcome(Activity $activity): ?string{...}© LocalSearch.php© LocalSearchinterface.php46public function conventCallStatus(Activity Sactivity): stringA DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D211212213214215- V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;.id, CASEWHENidFROMsocial.1 on V.id = sa.:1..n<->1: on t.Lid = 1052 andIMaccounts wheiactivitiesW Windsurf Teams17:21UTF-8P. 4 spaces...
|
NULL
|
-112304473328366416
|
NULL
|
visual_change
|
ocr
|
NULL
|
PhpStormFileEditViewNavigateCodeLaravelRefactorRun PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelp•FV faVsco.jsv* #12066 on JY-20725-handle-HS-search-rate-limit k vabl100% (<47HandleHubspotRateLimitTestv8• Thu 14 May 17:26:26* :QProjectv© ReportController.php© AutomatedReportGenerated.phpTrackAutomatedReportGeneratedEvent.phpPlaybackController.php:=custom.logT SyncCrmEntitiesTrait.phpUserAutomatedReportsController.phpPlanhatService.phpAutomatedReportResult.phpSendReportJob.phpT SyncFieldsTrait.php() WriteCrmTrait.php© DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.phpDecorateActivity.php X> O Utils.© Service.phpT LogActivityTrait.php© PlainTextDecorateActivity.php© ActivityPlaybookTrait.php© CrmHelperRepository.php> D Webhook© AccountController.phpT IntegrationAppTrait.php.env.staging18.••E.env© DetachActivityObject.php© BatchSyncCollector.php© BatchSyncRedisService.phpRematchActivityOnCrmObjectDetach.phpMatchActivityCrmData.phpClient.phpHubspotPaginationService.php© Client.php© ClosedDealStagesService.pt© HandleHubspotRateLimit.phpUseC DealFieldsService.php712© DecorateActivity.php© FieldDefinitions.php© FieldTypeConverter.php1314class DecorateActivity extends BaseDecorateActivity© HubspotClientinterface.php© HubspotTokenManager.php© PayloadBuilder.php1516public const string JIMINNY_MARKER = 'Jiminny Summary:';© RemoteCrmObjectManipulatResponseNormalize.php© Service.php© SyncFieldAction.php© SyncRelatedActivityManage© WebhookSyncBatchProcessv D IntegrationApp> [J Accessors> Api|> D ConfigD DTOD FiltersD Jobs0 ProspectSearchStrategy17181920|212223242526272829public function generateTitle(Activity $activity): ?stringif ($activity->hasTitleO)) {$title = $activity->getTitle();} elseif (Sactivity->hasActivityType)) {Stitle = Sactivity->getActivityType() ->getName();} else {$title = 'Conference Call';return Stitle;> D ServiceTraits© DataClient.php© DecorateActivity.php3045public function convertMeetingOutcome(Activity $activity): ?string{...}© LocalSearch.php© LocalSearchinterface.php46public function conventCallStatus(Activity Sactivity): stringA DamntaCaarch nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]D211212213214215- V234Go jiminny0841A3 X4 A Vm migrations oim teams wherem crm_layouts !iM crm_layout_eiIM crm_fields Wim features;m team_feature:m opportunitie:m teams;.id, CASEWHENidFROMsocial.1 on V.id = sa.:1..n<->1: on t.Lid = 1052 andIMaccounts wheiactivitiesW Windsurf Teams17:21UTF-8P. 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
45552
|
1629
|
3
|
2026-05-14T14:42:11.851804+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-14/1778 /Users/lukas/.screenpipe/data/data/2026-05-14/1778769731851_m1.jpg...
|
PhpStorm
|
faVsco.js – DataClient.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.054166667,"top":0.027777778,"width":0.08055556,"height":0.035555556},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12066 on JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.13472222,"top":0.027777778,"width":0.25555557,"height":0.035555556},"on_screen":true,"help_text":"Pull request #12066 exists for current branch JY-20725-handle-HS-search-rate-limit, 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.6326389,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.6645833,"top":0.027777778,"width":0.15902779,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.82361114,"top":0.027777778,"width":0.023611112,"height":0.035555556},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-7759925082980464890
|
-7195274138718106135
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12066 on JY-20725-handle Project: faVsco.js, menu
#12066 on JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
PhpStormFileEditViewNavigateCodeLaravelRefactorRunToolsGitWindowHelpabl•FV faVsco.jsv#12066 on JY-20725-handle-HS-search-rate-limit k vHandleHubspotRateLimitTestv100% С8• Thu 14 May 17:42:11QProjectvT DeleteCrmEntityTrait.phpDeleteAccountJob.php© ImportActivityTypes.phpT WriteCrmTrait.php:=custom.log> MetadataAccessorsHubspot/DecorateActivity.phpIntegrationAppServiceTrait.phpIntegrationApp/Service.php( RemoteWriteAccessor.phpT AccountAccessor.php• BaseAccessor.php© DataClient.php X© IntegrationApp/DecorateActivity.php© Activity.phpSalesforce/Service.phpLogActivityTrait.php• ContactAccessor.php© Playbook.phpPipedrive/Service.phpClose/Service.phpCopper/Service.php© BullhornService.phpDealAccessor.phpPlainTextDecorateActivity.phpT ActivityPlaybookTrait.php© CrmHelperRepository.phpAccountController.php=.env.staging18© IntegrationAppAccessExce• LeadAccessor.php.env© DetachActivityObject.phpRematchActivityOnCrmObjectDetach.php© MatchActivityCrmData.phpClient.phpT MeetingAccessor.phpRegisterEventsAccessor.pt© HubspotPaginationService.php© HandleHubspotRateLimit.php32class DataClient implements Clientinterface• RemoteWriteAccessor.php103• SystemStateAccessor.phppublic function updateRecordById(string $objectType, string $objectId, array $data): array{...}112T UserAccessor.php2 usages• Арi113private function getAuthToken(): stringf...}ConfigO DTO124> O Filters4 usages125protected function getAdminToken(): string{...}v d Jobs132© CrmEntitiesFullSyncJob.ph133protected function getRequestBuilder(© DeleteRemoteTeamJob.ph134T IntegrationAppService TraitEnumUrlInterface SresourceUrl,135array $bodyParams = [],© SubscribeForEventsJob.ph136string $method = RequestBuilder: :METHOD_POST,© TeamInitialSyncJob.php137© UnsubscribeForEventsJob.?string $uriParams = null,138© UpdateProfileRelatedEntiti): RequestBuilder {.|.3155© ValidateTeamActiveConne156protected function refreshToken(): voidf...}• ProspectSearchStrategy164• ServiceTraits165/**© DataClient.php166© DecorateActivity.php* Pointless, yet mandatory method.© LocalSearch.php167*/168 € ›public function getMinimumApiVersion(: float{...}• LocalSearchinterface.php172© RemoteSearch.php173© Service.phpv • ListenersC ConvertLeadActivities.php© Purnel onkunCache nhnWorkspace associated with branch 'JY-20725-handle-HS-search-rate-limit' has been restored // Rollback // Configure... (today 16:17)=laravel.logSF [jiminny@localhost]A HS_local [jiminny@localho:W4 console [QAI PROD] X4 console [PROD]A console (EU]Go jiminny084143 ×4 л215•m_layout_id =2162,1661,66799,66217218219id = 33;220221222223224id THEN •(own225226227228— 229- 230hubspot':-231232233 V= 11512582;234W Windsurf Teams133:24UTF-8Ca 4 spaces...
|
45550
|
NULL
|
NULL
|
NULL
|
|
35163
|
1316
|
16
|
2026-05-13T12:15:54.213966+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674554213_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormFV faVsco.js vINavigareCodeg9 JY-20891-imp PhostormFV faVsco.js vINavigareCodeg9 JY-20891-improve-sms-text-reProledey© MailboxController.php© coachingreedo© ConversationsCTextkelayservice.ong© Sso.phpleDhCalelerleleelnitC Engagementcorc) leaminsicnisAuThemeTopicsCoTopicsinDealsCc› D Themesv D UserAutomatedRep© UserAutomatedfv DV2(C) Activitvv2contreC) AskAnvthinacon(C) DealsV2Controll© OnDemandV2CcC) PlavlistControlle© PlaylistShareCorYe) DlavlistTrackeor© TranscriptionSur© UploadControlle© ActionltemsControl0 ActivitvController.g© AiCrmNotesControlbasecontroller.onp© ClientTokenControlc cimcontroller.ono• DealLevelrromorsec) DealRiskcontroller.c) Instantmeetinaconc) MeetinascontrollerC) MetadataControllenC) MomentController.rc) NumberAllocatorce© OrganizationLicensYC) OraanizationMembilC) OraanizationRetentossocontroller.ongSmsMessage.png© SmsLength.phpclass Dashboardcontroller extends BasecontrollerC) OraanizationPolesC 10d© OrganizationSyncC 101C) PartnerController.n© PhoneNumberConti 102Ca DiavhackController 170.© PlaylistController.pt€ ScimController.php 173ououc tunction ferchreguest Srequest: sonresponse5|X1 A v 632633'engagement-stats' => $this-›getEngagementStats($filterSet),'common-topics' => $this->getCommonTopics(SfilterSet).private function getActivity0verTime(User $user, FilterDefinitionCollection $filterSet): arraySavailableActivityChannels = Collection: :make([Models\Activity: : TYPE_CONFERENCE,Nodels acuivity..lYre_surirhune,Models\Activity::TYPE_SOFTPHONE_INBOUND,Models\Activity::TYPE_SMS_OUTBOUND,1):SactivityChannels = $availableActivityChannels->flip()->map static tunction O: 1nt %return 0:}):Sdata = Sthis->repository->qetDashboardActiviltv0verTime(Suser. $filterSet)->map(static function (array $data) use (SactivityChannels): array €return Sactivitvchannels->map(static function (int $defaultValue, string $activityChannel) use ($data): int {return sdatalSactivitvchanne. SdefaultValue:->valueso.all0.return['Labels' => $activityChannels->keys()-›all(),Inaintel => Sdata-sal10)private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): arrayf...private function getCoachingOverTime(slavc to new hranch oriain/.IV.20801_imnrove-cmc-teyt-relavs /| Create null reauect (22 minutes aao)E laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] X A console [EU]A console [STAGING] Tx: AutovORDER BY t.name, calendar domain:So jiminny040 A1 A40 V 65 ^select * trom users u jo1n calendars c 1<->I.n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 14049485: # team 563 crm 53select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uvid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate limits:select * from &ated_report_results where gedie type = 'pdf' and status = 2and id IN (18,1872):select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text nelavs where created at > 12026-05-014# and id IN (32415, 32416);and id = 32412;select * from users where team_id = 2 and email like "%scott%' and id = 29510;672SELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436sonnt keview • In 40m100% L2Wed 13 May 15:15:54U AskJiminnyReportActivityServiceTest~CascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0 ..Complete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php: 33-680 phpoublic function fetch Request Sreauest): sonResoonseSuser = Sthis→>getUserFromRequest(Srequest:Scriteria = criteria:: createrromRequest(Srequest→>all, Suser->gettimezone)=Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),suserSrequest->validate SfilterSet->getValidationRules→>al100:return Sthis->response->withArray(l→ sultterser renderl),'widgets' ='act ivitv-over-time' = sthis->aetActivitvOverTime(suser. sfilterSet).Context set: CONTEXT TEAM INSIGHTS ACTIVITY = 'team-insichts-activity'2. Filter Set CreationFile: ActivitySearch.php:132-244private function getTeamInsightsPageFilters(bool SisExport = false): FilterDefinitionCollectionreturn FilterDefinitionCollection::make/Collection: :make(FilterDefinition\TeamInsights\DateRangeFilter::class,Filterderinition Teaminsiants Exists::class.RestrictUserGroupScope: : class,RestrictActivityChannel::class.RectrictPublicActivitiecOnlv:.class.Ask anvthina (84L)« Code SWF-1.6W Windsurf TeamcUTF-8f 4 spaces...
|
NULL
|
1698039176161872467
|
NULL
|
click
|
ocr
|
NULL
|
PhostormFV faVsco.js vINavigareCodeg9 JY-20891-imp PhostormFV faVsco.js vINavigareCodeg9 JY-20891-improve-sms-text-reProledey© MailboxController.php© coachingreedo© ConversationsCTextkelayservice.ong© Sso.phpleDhCalelerleleelnitC Engagementcorc) leaminsicnisAuThemeTopicsCoTopicsinDealsCc› D Themesv D UserAutomatedRep© UserAutomatedfv DV2(C) Activitvv2contreC) AskAnvthinacon(C) DealsV2Controll© OnDemandV2CcC) PlavlistControlle© PlaylistShareCorYe) DlavlistTrackeor© TranscriptionSur© UploadControlle© ActionltemsControl0 ActivitvController.g© AiCrmNotesControlbasecontroller.onp© ClientTokenControlc cimcontroller.ono• DealLevelrromorsec) DealRiskcontroller.c) Instantmeetinaconc) MeetinascontrollerC) MetadataControllenC) MomentController.rc) NumberAllocatorce© OrganizationLicensYC) OraanizationMembilC) OraanizationRetentossocontroller.ongSmsMessage.png© SmsLength.phpclass Dashboardcontroller extends BasecontrollerC) OraanizationPolesC 10d© OrganizationSyncC 101C) PartnerController.n© PhoneNumberConti 102Ca DiavhackController 170.© PlaylistController.pt€ ScimController.php 173ououc tunction ferchreguest Srequest: sonresponse5|X1 A v 632633'engagement-stats' => $this-›getEngagementStats($filterSet),'common-topics' => $this->getCommonTopics(SfilterSet).private function getActivity0verTime(User $user, FilterDefinitionCollection $filterSet): arraySavailableActivityChannels = Collection: :make([Models\Activity: : TYPE_CONFERENCE,Nodels acuivity..lYre_surirhune,Models\Activity::TYPE_SOFTPHONE_INBOUND,Models\Activity::TYPE_SMS_OUTBOUND,1):SactivityChannels = $availableActivityChannels->flip()->map static tunction O: 1nt %return 0:}):Sdata = Sthis->repository->qetDashboardActiviltv0verTime(Suser. $filterSet)->map(static function (array $data) use (SactivityChannels): array €return Sactivitvchannels->map(static function (int $defaultValue, string $activityChannel) use ($data): int {return sdatalSactivitvchanne. SdefaultValue:->valueso.all0.return['Labels' => $activityChannels->keys()-›all(),Inaintel => Sdata-sal10)private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): arrayf...private function getCoachingOverTime(slavc to new hranch oriain/.IV.20801_imnrove-cmc-teyt-relavs /| Create null reauect (22 minutes aao)E laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] X A console [EU]A console [STAGING] Tx: AutovORDER BY t.name, calendar domain:So jiminny040 A1 A40 V 65 ^select * trom users u jo1n calendars c 1<->I.n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 14049485: # team 563 crm 53select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uvid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate limits:select * from &ated_report_results where gedie type = 'pdf' and status = 2and id IN (18,1872):select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text nelavs where created at > 12026-05-014# and id IN (32415, 32416);and id = 32412;select * from users where team_id = 2 and email like "%scott%' and id = 29510;672SELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436sonnt keview • In 40m100% L2Wed 13 May 15:15:54U AskJiminnyReportActivityServiceTest~CascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0 ..Complete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php: 33-680 phpoublic function fetch Request Sreauest): sonResoonseSuser = Sthis→>getUserFromRequest(Srequest:Scriteria = criteria:: createrromRequest(Srequest→>all, Suser->gettimezone)=Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),suserSrequest->validate SfilterSet->getValidationRules→>al100:return Sthis->response->withArray(l→ sultterser renderl),'widgets' ='act ivitv-over-time' = sthis->aetActivitvOverTime(suser. sfilterSet).Context set: CONTEXT TEAM INSIGHTS ACTIVITY = 'team-insichts-activity'2. Filter Set CreationFile: ActivitySearch.php:132-244private function getTeamInsightsPageFilters(bool SisExport = false): FilterDefinitionCollectionreturn FilterDefinitionCollection::make/Collection: :make(FilterDefinition\TeamInsights\DateRangeFilter::class,Filterderinition Teaminsiants Exists::class.RestrictUserGroupScope: : class,RestrictActivityChannel::class.RectrictPublicActivitiecOnlv:.class.Ask anvthina (84L)« Code SWF-1.6W Windsurf TeamcUTF-8f 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35162
|
1315
|
15
|
2026-05-13T12:15:54.243352+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674554243_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-8820308511646877981
|
-7196540777719685949
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Firefox FileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•MorelallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSprint Review - in 45 m100% <78•Wed 13 May 15:15:54Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35161
|
1316
|
15
|
2026-05-13T12:15:49.887145+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674549887_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891- PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891-improve-sms-text-reProledey© ActivityCommentRepositc©ActivityLogRepository.ph|Textkelayservice.ong© ActivityMessageRepositol© ActivityMomentRepositor: © TextMessagingService.php© ActivityProviderRepositor© ActivityRepository.php© ActivitySearchFilterReposActivityShareRepository.f© ActivityUploadSettingRepC AIPromptkepository.ong© AskAnythingRepository.pl(c) Automateaкeporiskeposic) Coachingreedbackkedosc) crmTemolateRepositorv.rC) DeviceRerositorv.oho© ElasticActivityRepository.(c) EmailMessadeRenositorv.© GenericAiPromptReposito© GroupRepository.php© InboxEmailBatchRepositoCInboxRepositorv.oho© InvitationRepository.php© JobRepository.php© LanguageRepository.php© MomentRepository.php© NotificationRepository.ph© ParticipantRepository.php© ParticipantSpeechReposit© ParticipantStatsRepositor© PlaybookCategoryReposit© PlaybookRepository.phpPlaylistActivityRepository.© PlaylistRepository.phpPlaylistShareRepository.p(C) RolechangeEventReposit© RoleRepository.php(c) SearchRenositorv.ono© SnapshotRepository.phpC) SocialAccountRevositorv.© StageRepository.php(C) SubscriotionSetRevositon©TaskRepository.php(C) TeamA ContextRenositon611© TeamDomainsRepository.612(c) TeaminciahtcRenositorv.r© TeamRepository.php(C) ThemeRenositorv nhnclass TeamInsightsRepositorypublic function getcoachingActivitlesuveri1mebraLldowncint $page,int $limit = 25): Collection {...}public function getEngagementActivitiesDrillDown(User Sconsumer,FilterDefinitionCollection $filterSet,string selasticsearchcocumn,int $page,int $limit = 25,): Collection {.}643public function getConversationsActivityChannelPerUserAggregation(FilterDefinitionCollection $filterSet): 646• public function getDashboardActivityOverTimeCUser suserFilterDefinitionCollection $filterSet,string shistoqraminterval =day): Collection {stmezoneuttser = suser->oet.zmezoneurtserr653ShoolQuerv = SfilterSet->aetBoolQuervaSfilterSet->extractElasticSearchQueries()657Sauery = new Quervo)659660->setSourced os: false)->addAggregation(inew Filter(name: 'voice_activities',664(clone $boolQuery)-665->addFilter(666(new BoolQuery())->addShould((new Term())->setTerm( key: 'type.keyword',value: Activity: : TYPE_T 668->addShould((new Term())->setTerm( key: 'type.keyword',Activity::TYPE_S 669->addShould((new Term())->setTerm( key: 'type.keyword',value: Activity:: TYPE,- 670->addFilter(new Exists( field: 'actual_start_time')672v->addAggregation(uched.IV.20801_imnrove.cmc-teyt_rolavs ta.new hranch.oriain/.IV.20801_imnrove.cmc-teyt-rolavs //CGreate null reauect (22 minutes.aaol(new DateHistogram( name:) 'over_time', field: 'actual_end_time', ShistogramInterval))© MailboxController.php• sso.onp© SsoController.phpE custom.logA console [STAGING]E laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] X A console (EU]©smsmessage.ongTx: AutovORDER BY t.name, calendar domain:So jiminny© SmsLength.php040 A1 A40 V 65 ^A1 46 X11 A 4 632633select * trom users u jo1n calendars c 1<->I..n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 14049485: # team 563 crm 53select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate_limits;select * from &mated_report_results where nedia,tyRe = 'pdf' and status = 2and id IN (18,18/201select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text nelavs where created at > 12026-05-014# and id IN (32415, 32416);and id = 72412.select * from users where team_id = 2 and email like '%scott%' and id = 29510;SELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436sonnt keview • In 40m100% L2Wed 13 May 15:15:49U AskJiminnyReportActivityServiceTest~CascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0..Complete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php: 33-680 phpoublic function fetch Request Sreauest): sonResoonseSuser = Sthis→>getUserFromRequest(SrequestScriteria = criteria::createrromRequest(Srequest→>all, Suser->gettimezone)=Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),suserSrequest->validate SfilterSet->getValidationRules→>al100:return Sthis->response->withArray(l→ sultterser renderl),'widgets' ='act ivitv-over-time' = sthis->aetActivitvOverTime(suser. sfilterSet).Context set: CONTEXT TEAM INSIGHTS ACTIVITY = 'team-insichts-activity'2. Filter Set CreationFile: ActivitySearch.php:132-244private function getTeamInsightsPageFilters(bool SisExport = false): FilterDefinitionCollectionreturn FilterDefinitionCollection:make(Collection: :make(FilterDefinition\TeamInsights\DateRangeFilter::class,Filterderinition Teaminsiohts.Exists::class.RestrictUserGroupScope: : class,RestrictActivityChannel::class.RectrictPublicActivitiecOnlv:.class.Ask anvthina (84L)« Code SWF-1.6UTF-8f 4 spaces...
|
NULL
|
4900938166904724442
|
NULL
|
click
|
ocr
|
NULL
|
PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891- PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891-improve-sms-text-reProledey© ActivityCommentRepositc©ActivityLogRepository.ph|Textkelayservice.ong© ActivityMessageRepositol© ActivityMomentRepositor: © TextMessagingService.php© ActivityProviderRepositor© ActivityRepository.php© ActivitySearchFilterReposActivityShareRepository.f© ActivityUploadSettingRepC AIPromptkepository.ong© AskAnythingRepository.pl(c) Automateaкeporiskeposic) Coachingreedbackkedosc) crmTemolateRepositorv.rC) DeviceRerositorv.oho© ElasticActivityRepository.(c) EmailMessadeRenositorv.© GenericAiPromptReposito© GroupRepository.php© InboxEmailBatchRepositoCInboxRepositorv.oho© InvitationRepository.php© JobRepository.php© LanguageRepository.php© MomentRepository.php© NotificationRepository.ph© ParticipantRepository.php© ParticipantSpeechReposit© ParticipantStatsRepositor© PlaybookCategoryReposit© PlaybookRepository.phpPlaylistActivityRepository.© PlaylistRepository.phpPlaylistShareRepository.p(C) RolechangeEventReposit© RoleRepository.php(c) SearchRenositorv.ono© SnapshotRepository.phpC) SocialAccountRevositorv.© StageRepository.php(C) SubscriotionSetRevositon©TaskRepository.php(C) TeamA ContextRenositon611© TeamDomainsRepository.612(c) TeaminciahtcRenositorv.r© TeamRepository.php(C) ThemeRenositorv nhnclass TeamInsightsRepositorypublic function getcoachingActivitlesuveri1mebraLldowncint $page,int $limit = 25): Collection {...}public function getEngagementActivitiesDrillDown(User Sconsumer,FilterDefinitionCollection $filterSet,string selasticsearchcocumn,int $page,int $limit = 25,): Collection {.}643public function getConversationsActivityChannelPerUserAggregation(FilterDefinitionCollection $filterSet): 646• public function getDashboardActivityOverTimeCUser suserFilterDefinitionCollection $filterSet,string shistoqraminterval =day): Collection {stmezoneuttser = suser->oet.zmezoneurtserr653ShoolQuerv = SfilterSet->aetBoolQuervaSfilterSet->extractElasticSearchQueries()657Sauery = new Quervo)659660->setSourced os: false)->addAggregation(inew Filter(name: 'voice_activities',664(clone $boolQuery)-665->addFilter(666(new BoolQuery())->addShould((new Term())->setTerm( key: 'type.keyword',value: Activity: : TYPE_T 668->addShould((new Term())->setTerm( key: 'type.keyword',Activity::TYPE_S 669->addShould((new Term())->setTerm( key: 'type.keyword',value: Activity:: TYPE,- 670->addFilter(new Exists( field: 'actual_start_time')672v->addAggregation(uched.IV.20801_imnrove.cmc-teyt_rolavs ta.new hranch.oriain/.IV.20801_imnrove.cmc-teyt-rolavs //CGreate null reauect (22 minutes.aaol(new DateHistogram( name:) 'over_time', field: 'actual_end_time', ShistogramInterval))© MailboxController.php• sso.onp© SsoController.phpE custom.logA console [STAGING]E laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] X A console (EU]©smsmessage.ongTx: AutovORDER BY t.name, calendar domain:So jiminny© SmsLength.php040 A1 A40 V 65 ^A1 46 X11 A 4 632633select * trom users u jo1n calendars c 1<->I..n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 14049485: # team 563 crm 53select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate_limits;select * from &mated_report_results where nedia,tyRe = 'pdf' and status = 2and id IN (18,18/201select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text nelavs where created at > 12026-05-014# and id IN (32415, 32416);and id = 72412.select * from users where team_id = 2 and email like '%scott%' and id = 29510;SELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436sonnt keview • In 40m100% L2Wed 13 May 15:15:49U AskJiminnyReportActivityServiceTest~CascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0..Complete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php: 33-680 phpoublic function fetch Request Sreauest): sonResoonseSuser = Sthis→>getUserFromRequest(SrequestScriteria = criteria::createrromRequest(Srequest→>all, Suser->gettimezone)=Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),suserSrequest->validate SfilterSet->getValidationRules→>al100:return Sthis->response->withArray(l→ sultterser renderl),'widgets' ='act ivitv-over-time' = sthis->aetActivitvOverTime(suser. sfilterSet).Context set: CONTEXT TEAM INSIGHTS ACTIVITY = 'team-insichts-activity'2. Filter Set CreationFile: ActivitySearch.php:132-244private function getTeamInsightsPageFilters(bool SisExport = false): FilterDefinitionCollectionreturn FilterDefinitionCollection:make(Collection: :make(FilterDefinition\TeamInsights\DateRangeFilter::class,Filterderinition Teaminsiohts.Exists::class.RestrictUserGroupScope: : class,RestrictActivityChannel::class.RectrictPublicActivitiecOnlv:.class.Ask anvthina (84L)« Code SWF-1.6UTF-8f 4 spaces...
|
35159
|
NULL
|
NULL
|
NULL
|
|
35160
|
1315
|
14
|
2026-05-13T12:15:49.885207+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674549885_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Firefox FileEditViewHistoryBookmarksToolsWindowHel Firefox FileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•MorelallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSprint Review - in 45 m100% <78•Wed 13 May 15:15:49Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
NULL
|
-4804116211032417520
|
NULL
|
click
|
ocr
|
NULL
|
Firefox FileEditViewHistoryBookmarksToolsWindowHel Firefox FileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•MorelallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSprint Review - in 45 m100% <78•Wed 13 May 15:15:49Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
35158
|
NULL
|
NULL
|
NULL
|
|
35159
|
1316
|
14
|
2026-05-13T12:15:39.134859+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674539134_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-3346245719057788321
|
-7196539678208059965
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
PhostormINavigareCodeFV faVsco.js vg9 JY-20891-improve-sms-text-reProledey© MailboxController.php© CoachingFeedb:© ConversationsCTextkelayservice.ong© Sso.phpossocontroller.ongleDhCalelerleleelnitC Engagementcor©smsMessage.png© SmsLength.phpc) leaminsicnisAuThemeTopicsCoTopicsinDealsCcclass Dashboardcontroller extends Basecontroulerououc tunction ferchreguest Srequest: sonresponseD Themesv → UserAutomatedRep© UserAutomatedfenoagemenc-staus = schis-›oeccnoadementscacs stilcersec).common-copncs = sch1s->qeccommoniop1csstzlcersec).v DV2(C) Activitvv2contrC) AskAnvthinacon© AskJiminnyRepo(C) DealsV2Controll© OnDemandV2CcC) PlavlistControllePlaylistShareCorYe) DlavlistTrackeor© TranscriptionSur© UploadControlleOeelelalne micelninielActivityController.p© AiCrmNotesControlbasecontroller.onp© ClientTokenControl• DealLevelrromorse5|X1 A v 632634C) MetadataControllenc) NumberAllocatorcd© OrganizationLicensYC) OraanizationMembilC) OraanizationPoleseii© OrganizationSyncC8 DartnerController nl 101© PhoneNumberContiYa DiauhackController© PlaylistController.pt 172") CrimControllor nhn1 usageprivate function getActivityoverlime(User suser, FilterDefinitionCollection SfilterSet): arraySavailableActivitvChannels = Collection:makediModels\Activity::TYPE_CONFERENCE,Models Activitv:: TYPE SOFTPHONE.Models \Activity::TYPE_SOFTPHONE_INBOUND,Models Activitv •TYps SMS NlltRollNni$activityChannels = $availableActivityChannels->flip()->map(static function (): int {return 0;F);$data = $this->repository->getDashboardActivity0verTime($user, $filterSet)->map(static function (array $data) use ($activityChannels): array {return sactivitychannels->map(static function (int $defaultValue, string $activityChannel) use ($data): int {return sdatalsactzv1tychannel ?? Sdetaultvaluer->valueso→>aloF);'labels' => SactivitvChannels->kevs()->al1@"points' => Sdata->allolprivate function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): arrayf….;llicaheAannotcachinanvonTimoelays to new branch origin/JY-20891-improve-sms-text-relays // Create pull request (33 minutes ago)E laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] xA console (EU)A console [STAGING] Tx: AutovORDER BY t.name, calendar domain:So jiminny040 A1 A40 V 65 ^select * trom users u jo1n calendars c 1<->I.n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 14049485: # team 563 crm 537select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uvid_to_bin(^8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate limits:select * from &ated_report_results where gedie type = 'pdf' and status = 2and id IN (18,1872):select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text nelavs where created at > 12026-05-014# and id IN (32415, 32416);and id = 32412;select * from users where team_id = 2 and email like "%scott%' and id = 29510;672vSELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436sonnt keview • In 40m100% L2Wed 13 May 15:15:38U AskJiminnyReportActivityServiceTest~CascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0 ..Complete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php: 33-680 phpoublic function fetchRequest Sreauest): sonResoonseSuser = Sthis→>getUserFromRequest(Srequest:Scriteria = Criteria::createrromRequest(Srequest→>all, Suser->gettimezone):Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),suserSrequest->validateSfilterSet->getValidationRules→>al100:return Sthis->response->withArray(l→ sultterser renderl),'widgets' ='act ivitv-over-time' = sthis->aetActivitvOverTime(suser. sfilterSet).Context set: CONTEXT TEAM INSIGHTS ACTIVITY = 'team-insichts-activity'2. Filter Set CreationFile: ActivitySearch.php:132-244private function getTeamInsightsPageFilters(bool SisExport = false): FilterDefinitionCollectionreturn FilterDefinitionCollection::make/Collection: :make(FilterDefinition\TeamInsights\DateRangeFilter::class,Filterderinition Teaminsiants Exists::class.RestrictUserGroupScope: : class,RestrictActivityChannel::class.RectrictPublicActivitiecOnlv:.class.Ask anvthina (84L)« Code SWF-1.6WN Windsurf Toams 71.22 UTF.9f 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35158
|
1315
|
13
|
2026-05-13T12:15:39.124853+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674539124_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
FirefoxFileEditViewHistoryBookmarksToolsWindowHelp FirefoxFileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•MorelallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSprint Review - in 45 m100% <78•Wed 13 May 15:15:38Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
NULL
|
5381841783538770368
|
NULL
|
click
|
ocr
|
NULL
|
FirefoxFileEditViewHistoryBookmarksToolsWindowHelp FirefoxFileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•MorelallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSprint Review - in 45 m100% <78•Wed 13 May 15:15:38Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35157
|
1316
|
13
|
2026-05-13T12:15:34.869298+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674534869_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
7581618884890279806
|
-8204352174202572862
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
PhostormProledeyINavigareCodeg9 JY-20891-improve-sms-text-r© coachingreedoc conversationsec) leaminsicnisAuThemeTopicsCoTopicsinDealsCc› D Themesv → UserAutomatedRep© UserAutomatedfv DV2(C) Activitvv2contrC) ASKAnvininacon(C) DealsV2Controll© OnDemandV2CcC) PlavlistControllePlaylistShareCorPlaylistTrackCor© TranscriptionSur© UploadControlleOeelelalne micelninielActivityController.pc Alurmnotescontrobasecontroller.onp'ealalealtalainra• DealLevelrromorse24 G33 23YC) OraanizationMemb.© OrganizationSyncCC) PartnerController.n© PhoneNumberContiYa DiauhackControllerPlaylistController.pt") CrimControllor nhn© MailboxController.php• sso.onpossocontroller.ongSmsMessage.png© SmsLength.phpclass Dashboardcontroller extends Basecontroller5|X1 A y 632633634public function __construct(Kesponse sresponseprivate readonly ActivitySearch\Service\ActivitySearch $activitySearch,privace readonly leaminsighcskeposicory sreposicory) 4..7GET /api/v1/teapubuac function fetchRequest Srequest: JsonResponse642Suser = Sthis->getUserFromRequest(Srequest):Scriteria = Criteria:: createFromRequest Srequest-›allo. Suser->qettimezoneoo:$filterSet = $this->activitySearch->getTeamInsigh|tsPageFilterSet(Scriteria->setContext( context: ContextAwareFilterDefinitioninterface::CONTEXT_TEAM_INSIGHTS_ACTIVIT647SusenSrequest->validate(SfilterSet->getValidationRules()->all()652$dateTimeRangeStartsAt = $request->has( key: 'start_date')? CarbonImmutable: :createFromFormat ( format: 'Y-m-d H:i:S', $request-›input( key: 'start_date')).nuLl$dateTimeRangeEndsAt = $request-›has ( key: 'end_date')? CarbonImmutable: :createFromFormat( format:) 'Y-m-d H:i:s', $request->input( key: 'end_date')).nuLl655657659666return $this->response->withArray(['filters' => $filterSet->render(),'widgets' =>'activity-over-time' => Sthis->qetactiv1tvovertimesuser, Stilterset).'coaching-breakdown' => Sthis->qetCoachingBreakdownBvUserRole(Suser. Scriteria).'coaching-over-time' => Sthis->qetcoachinqoverT1mesuser.Scriteria,SdateTimeRangeStartsAt.SdateTimeRangeEndsAt664665667669— 672 vengagement-stats' => $this->getEngagementStats($filterSet),'common-tonics' => Sthis->aetCommontonics(SfilterSet).laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] X A console (EU]A console [STAGING]Tx: AutovORDER BY t.name, calendar domain:So jiminny040 A1 A40 V 65 ^select * trom users u jo1n calendars c 1<->I.n. on c.user 1d = U.1dwhere U.team_ 1d = 882^select * from activities where id = 74049485: # team 563 crm 53select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uvid_to_bin(^8827f672-202d-4162-9d04-73ff5f0566a9') = uvidor uuid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate Zimits:select * from &and id IN (18,187201select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);ted_report_results where nedia tyRe = 'paf' and status = 2SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text nelavs where created at > 12026-05-014# and id IN (32415, 32416);and id = 32412;select * from users where team_id = 2 and email like "%scott%' and id = 29510;SELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436sonnt keview • In 40m100% L2Wed 13 May 15:15:34U AskJiminnyReportActivityServiceTest~CascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0 ..Complete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php: 33-680 phpoublic function fetchRequest Sreauest): sonResoonseSuser = Sthis→>getUserFromRequest(SrequestScriteria = criteria:: createrromRequest(Srequest→>all, Suser->gettimezone)=Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),suserSrequest->validate SfilterSet->aetValidat ionRules→>al100:return Sthis->response->withArray(l→ sultterser-renderl,'widgets' ='act ivitv-over-time' = sthis->aetActivitvOverTime(Suser. sfilterSet).Context set: CONTEXT TEAM INSIGHTS ACTIVITY = 'team-insights-activity'2. Filter Set CreationFile: ActivitySearch.php:132-244private function getTeamInsightsPageFilters(bool SisExport = false): FilterDefinitionCollectionreturn FilterDefinitionCollection::make/Collection: :make(FilterDefinition\TeamInsights\DateRangeFilter::class,Filterderinition Teaminsiohts.Exists::class.RestrictUserGroupScope: : class,RestrictActivityChannel::class.RectrictPublicActivitiecOnlv:.class.Ask anvthina (84L)« Code SWF-1.6W Windsurf Teamc28.58 UTF.9f 4 spaces...
|
35155
|
NULL
|
NULL
|
NULL
|
|
35156
|
1315
|
12
|
2026-05-13T12:15:34.869293+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674534869_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
7581618884890279806
|
-8204352174202572862
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
FirefoxFileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•MorelallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSprint Review - in 45 m100% <78•Wed 13 May 15:15:34Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
35154
|
NULL
|
NULL
|
NULL
|
|
35151
|
1316
|
10
|
2026-05-13T12:15:20.738990+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674520738_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.38464096,"top":0.17478053,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.17318435,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.40093085,"top":0.17318435,"width":0.006981383,"height":0.018355945},"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"bounds":{"left":0.122340426,"top":0.11731844,"width":0.29986703,"height":0.88268155},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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.40957448,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.41821808,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.42918882,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.43783244,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.44647607,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.4574468,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.46841756,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"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.4950133,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.50598407,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.7084442,"top":0.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.67785907,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.69015956,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.6994681,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"bounds":{"left":0.7117686,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7237367,"top":0.12210695,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.73105055,"top":0.12210695,"width":0.006981383,"height":0.018355945},"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4706803030989287118
|
2218881650218382925
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35150
|
1315
|
9
|
2026-05-13T12:15:20.731169+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674520731_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4706803030989287118
|
2218881650218382925
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
35148
|
NULL
|
NULL
|
NULL
|
|
35149
|
1316
|
9
|
2026-05-13T12:14:43.856640+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674483856_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.38464096,"top":0.17478053,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.17318435,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.40093085,"top":0.17318435,"width":0.006981383,"height":0.018355945},"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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.40957448,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.41821808,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.42918882,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.43783244,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.44647607,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.4574468,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.46841756,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"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.4950133,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.50598407,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.7084442,"top":0.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.67785907,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.69015956,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.6994681,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"bounds":{"left":0.7117686,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7237367,"top":0.12210695,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.73105055,"top":0.12210695,"width":0.006981383,"height":0.018355945},"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4706803030989287118
|
2218881650218382925
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
35147
|
NULL
|
NULL
|
NULL
|
|
35148
|
1315
|
8
|
2026-05-13T12:14:43.856662+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674483856_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4706803030989287118
|
2218881650218382925
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35143
|
1316
|
6
|
2026-05-13T12:14:21.630045+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674461630_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
Previous Highlighted Error...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.38464096,"top":0.17478053,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.17318435,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.40093085,"top":0.17318435,"width":0.006981383,"height":0.018355945},"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"bounds":{"left":0.122340426,"top":0.0,"width":0.2855718,"height":1.0},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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.40957448,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.41821808,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.42918882,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.43783244,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.44647607,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.4574468,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.46841756,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"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.4950133,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.50598407,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.7084442,"top":0.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.67785907,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.69015956,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.6994681,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"bounds":{"left":0.7117686,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7237367,"top":0.12210695,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5547984393176806690
|
-8344314095241406117
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
Previous Highlighted Error...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35142
|
1316
|
5
|
2026-05-13T12:14:20.041977+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674460041_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.38464096,"top":0.17478053,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.17318435,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.40093085,"top":0.17318435,"width":0.006981383,"height":0.018355945},"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"bounds":{"left":0.122340426,"top":0.0,"width":0.2855718,"height":1.0},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-7285285044845922623
|
-7200408448544417441
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}...
|
35140
|
NULL
|
NULL
|
NULL
|
|
35141
|
1315
|
5
|
2026-05-13T12:14:20.071777+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674460071_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
Previous Highlighted Error
Next Highlighted Error...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4632306959447202944
|
-8344314095241406113
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
Previous Highlighted Error
Next Highlighted Error...
|
35139
|
NULL
|
NULL
|
NULL
|
|
35139
|
1315
|
4
|
2026-05-13T12:14:06.883479+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674446883_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Firefox FileEditViewHistoryBookmarksToolsWindowHel Firefox FileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•More(all-Jiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala Cala• Support Daily • 1 m left100% <78•Wed 13 May 15:14:06Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
NULL
|
-6363969275488041375
|
NULL
|
click
|
ocr
|
NULL
|
Firefox FileEditViewHistoryBookmarksToolsWindowHel Firefox FileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•More(all-Jiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala Cala• Support Daily • 1 m left100% <78•Wed 13 May 15:14:06Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35138
|
1316
|
3
|
2026-05-13T12:14:00.033148+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674440033_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891- PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891-improve-sms-text-reProledey© NotSupportedException.g© NumberUnavailableExcep© OperationException.php©OutOfBoundsException.pl© QuotaExceededException© RateLimitException.php© RegistrationInvitationMisn® RequestQueuedForDeferr© ResponseException.phpkingcentralexception.ong© RingCentralExtensionNotfkunumeexception.phg© SequenceNumberExcepti-( servicelnceqration-xcepr24 G® ServiceUnavailableExcept( SidekickSettinasExceptio© SocialAccountNotFoundE( Socia AccountTokeninvali© SyncActivityException.phTenant solation Exceotion© TextRelayException.php(4TooManvFailedActivities..© TranscriptionNotindexedE(4) UnexoectedCallExceotion© UnexpectedEloquentMod( UneynectedValueSycenti© ZipAttackException.php› DFFMpeg> D Formatsv D Guards© Sso.php© ViewerGuard.php> D Helpers> D AccessTokenProviderv controllers~ DAPI> D AiCallScoringAlReports> D Dealinsiahts• Oooortunitv› D PageM Scorecards• M Settinasv Teaminsiahts(C) ActivitvStatsCon(C) CoachinaFeedb:(C) TeaminciahtsAic|© MailboxController.php© Sso.php© SsoController.phpSmsMessage.png© SmsLength.phpnamespace Jiminny\Http\Controllers\API\TeamInsights;› use ...class DashboardController extends BaseControllerpublic function __construct(kesponse sresponseprivare readonly Accivicysearch service Accivicysearch saccivicysearchprivate readonly leaminsightskepository srepository,) 4..7GET/api/vl/team-insights/dashboardteam_insights.dashboardpublic function fetch(Request $request): JsonResponsef...}orivate function getActivitvovertimeUser Suser. FilterdefinitionCollection SfilterSet): arravSavarlabLeActivitychannels = Collection::makedModels Activity: TYPE SOFTPHONE.Models\Activity::TYPE_SOFTPHONE_INBOUND,SactivityChannels = $availableActivityChannels->flip()->map(static function (): int {...});$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)->map(static function (array $data) use ($activityChannels): array {..});return ['Labels' => $activityChannels-›keys()->all(),'points' => $data-›all(),private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): arrayf...7orivate Function detcoachino0vertime.User Suser.Criteria Scriteria.E laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] X A console (EU]A console [STAGING]=| X11 v —670Tx: AutovORDER BY t.name, calendar domain:liminny040 A1 A40 V 65 ^select * trom users u jo1n calendars c 1<->I.n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 14049485: # team 563 crm 537select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate limits:select * from autlated_report_results where nedia,tyRe = 'pdf' and status = 2and id IN (18,1872):select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text_relays where created_at › '2026-05-01'# and id IN (32415, 32416);and id = 72412.select * from users where team_id = 2 and email like '%scott%' and id = 29510;- 672 vSELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436Support Daily - 2m left100% L2Wed 13 May 15:13:59U AskJiminnyReportActivityServiceTest vCascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0 ..ThoughtComplete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php:33-68bphppublic tunction tetch Request Srequest): Jsonkesponsesuser - schis->getuserr ronkequestisrequesciScriteria = Criteria::createFromRequest(Srequest-sallo. Suser->aetTimezone@):Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),return Sthis->response->withArray(["widaets! = l'activity-over-time' = Sthis->getActivityOverTime($user, $filterSet),/... other widaetsContext set: CONTEXT_TEAM_ INSIGHTS_ACTIVITY = 'tean-insights-activity'2. Filter Set CreationFile: ActivitySearch.php: 132-244a ohoorivate tunction detteaminsiantsPageFilters(oool SisExoort = talse): FilterderinitioncollectionPoweawlentaneaRlalethnoeoueCollection: :make(lspecial casesFilterDerinition Teaminsiahts DateRangeFilter::class.FilterDefinition\TeamInsights\Exists::class,Restrictream::class,RestrictUserGroupScope::classRectrictlicerActive:tclacelregular filtersAsk anvthina (84L)< CodeSWE-16W Windsurf Teams 71:60 UTF-8f 4 spaces...
|
NULL
|
-4477937132084257290
|
NULL
|
click
|
ocr
|
NULL
|
PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891- PhostormFV faVsco.js~VIewINavigareCodeg9 JY-20891-improve-sms-text-reProledey© NotSupportedException.g© NumberUnavailableExcep© OperationException.php©OutOfBoundsException.pl© QuotaExceededException© RateLimitException.php© RegistrationInvitationMisn® RequestQueuedForDeferr© ResponseException.phpkingcentralexception.ong© RingCentralExtensionNotfkunumeexception.phg© SequenceNumberExcepti-( servicelnceqration-xcepr24 G® ServiceUnavailableExcept( SidekickSettinasExceptio© SocialAccountNotFoundE( Socia AccountTokeninvali© SyncActivityException.phTenant solation Exceotion© TextRelayException.php(4TooManvFailedActivities..© TranscriptionNotindexedE(4) UnexoectedCallExceotion© UnexpectedEloquentMod( UneynectedValueSycenti© ZipAttackException.php› DFFMpeg> D Formatsv D Guards© Sso.php© ViewerGuard.php> D Helpers> D AccessTokenProviderv controllers~ DAPI> D AiCallScoringAlReports> D Dealinsiahts• Oooortunitv› D PageM Scorecards• M Settinasv Teaminsiahts(C) ActivitvStatsCon(C) CoachinaFeedb:(C) TeaminciahtsAic|© MailboxController.php© Sso.php© SsoController.phpSmsMessage.png© SmsLength.phpnamespace Jiminny\Http\Controllers\API\TeamInsights;› use ...class DashboardController extends BaseControllerpublic function __construct(kesponse sresponseprivare readonly Accivicysearch service Accivicysearch saccivicysearchprivate readonly leaminsightskepository srepository,) 4..7GET/api/vl/team-insights/dashboardteam_insights.dashboardpublic function fetch(Request $request): JsonResponsef...}orivate function getActivitvovertimeUser Suser. FilterdefinitionCollection SfilterSet): arravSavarlabLeActivitychannels = Collection::makedModels Activity: TYPE SOFTPHONE.Models\Activity::TYPE_SOFTPHONE_INBOUND,SactivityChannels = $availableActivityChannels->flip()->map(static function (): int {...});$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)->map(static function (array $data) use ($activityChannels): array {..});return ['Labels' => $activityChannels-›keys()->all(),'points' => $data-›all(),private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): arrayf...7orivate Function detcoachino0vertime.User Suser.Criteria Scriteria.E laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] X A console (EU]A console [STAGING]=| X11 v —670Tx: AutovORDER BY t.name, calendar domain:liminny040 A1 A40 V 65 ^select * trom users u jo1n calendars c 1<->I.n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 14049485: # team 563 crm 537select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate limits:select * from autlated_report_results where nedia,tyRe = 'pdf' and status = 2and id IN (18,1872):select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text_relays where created_at › '2026-05-01'# and id IN (32415, 32416);and id = 72412.select * from users where team_id = 2 and email like '%scott%' and id = 29510;- 672 vSELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436Support Daily - 2m left100% L2Wed 13 May 15:13:59U AskJiminnyReportActivityServiceTest vCascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0 ..ThoughtComplete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php:33-68bphppublic tunction tetch Request Srequest): Jsonkesponsesuser - schis->getuserr ronkequestisrequesciScriteria = Criteria::createFromRequest(Srequest-sallo. Suser->aetTimezone@):Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),return Sthis->response->withArray(["widaets! = l'activity-over-time' = Sthis->getActivityOverTime($user, $filterSet),/... other widaetsContext set: CONTEXT_TEAM_ INSIGHTS_ACTIVITY = 'tean-insights-activity'2. Filter Set CreationFile: ActivitySearch.php: 132-244a ohoorivate tunction detteaminsiantsPageFilters(oool SisExoort = talse): FilterderinitioncollectionPoweawlentaneaRlalethnoeoueCollection: :make(lspecial casesFilterDerinition Teaminsiahts DateRangeFilter::class.FilterDefinition\TeamInsights\Exists::class,Restrictream::class,RestrictUserGroupScope::classRectrictlicerActive:tclacelregular filtersAsk anvthina (84L)< CodeSWE-16W Windsurf Teams 71:60 UTF-8f 4 spaces...
|
35136
|
NULL
|
NULL
|
NULL
|
|
35137
|
1315
|
3
|
2026-05-13T12:14:00.018792+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674440018_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Firefox FileEditViewHistoryBookmarksToolsWindowHel Firefox FileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•More> 0lallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSupport Daily • 2m left100% <78•Wed 13 May 15:13:59Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
NULL
|
-2075834801708757864
|
NULL
|
click
|
ocr
|
NULL
|
Firefox FileEditViewHistoryBookmarksToolsWindowHel Firefox FileEditViewHistoryBookmarksToolsWindowHelp• 0APPapp/Console/Commands/Activities/SetupIntegration/TwilioSetS3RecordingCredentialsCommand.bapp/Console/Kernel.phpapp/Jobs/ImportRemoteTrackJob.phpapp/Services/Activity/Twilio/S3RecordingCredentialsService.phptests/Feature/Jobs/ImportRemoteTrackJobTest.phptests/Unit/Component/Encoding/Job/AnalyzeTrackChannelsJobTest.phptests/Unit/Component/FFMpeg/Services/GetSpeechIntervalsTest.phptests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTest.php10 files changed, 823 insertions(+), 23 deletions(-)create mode 100644 app/Console/Commands/Activities/SetupIntegration/TwilioSetS3Recordingcreate mode 100644 app/Services/Activity/Twilio/S3RecordingCredentialsService.phpcreate mode 100644 tests/Unit/Services/Activity/Twilio/S3RecordingCredentialsServiceTestlukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ co -b JY-20891-improve-;Switched to a new branch 'JY-20891-improve-sms-text-relays'lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)docker exec -it docker_lamp_1 ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.plPHP CS Fixer 3.87.1 Alexander by Fabien Potencier, Dariusz Ruminskicontributors.Running 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.Loaded configdefault from-php-cs-fixer.dist.php"5665/5665100%1) app/Jobs/Mailbox/EmailTextRelay.php (no_unused_imports)begin diff/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php+++/home/jiminny/app/Jobs/Mailbox/EmailTextRelay.php-16,7 +16,6 @@use Jiminny\Mail\Activities|SmsRelayFailed;use Jiminny\Models\Activity;use Jiminny Models \TextRelay;Jiminny\Models\User;useJiminny\Repositories\UserRepository;use Jiminny\Rules\SmsMessage;use Jiminny\Services\Mail\TextRelayService;end diffFixed 1 of 5665 files in 52.535 seconds, 67.00 MBmemory usedWhat's next:Try Docker Debug for seamless, persistent debugging tools in any containeror image →Learn more at https://docs.docker.com/go/debug-cli/lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (JY-20891-improve-sms-text-relays)HomeDMsActivityFilesLater..•More> 0lallJiminny ...# contusion-clinic# curiosity_lab# engineering# general# jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...• Direct messages. Nikolay Ivanovd. James GrahamStoyan Tanev®. Galya Dimitrova ORe Steliyan Georgiev&. Petko Kashinskie. Aneliya Angelova8. Stefka StoyanovaB. Vasil VasilevLukas Kovalik y...i: AppsToastJira CloudConala CalaSupport Daily • 2m left100% <78•Wed 13 May 15:13:59Describe what you are looking for# releases8 226 0MessagesC FilesBookmarks+3 new messagesNewCircleCI AP.-Deployment Successful!Project: appWhen:05/13/202611:57:10Tag:View JobGitHub APP3:10 PM6 new commits pushed to master by Vasil-Jiminny851bf1a7 - Remove ignored records that causelocal phpstan errors. No functional changes.d08f0260 - Merge branch 'master' intoremove-phpstan-errorsb2d676c3 - Merge branch 'master' intoremove-phpstan-errors1ff6f70f - Merge branch 'master' intoremove-phpstan-errors62a7fe62 - Merge branch 'master' intoremove-phpstan-errorsShow morejiminny/app Added by GitHubVasil Vasilev 3:11 PMStopped. The PR is internal dev optimisation, noneed to reach prod.Message #releases+..•...
|
35135
|
NULL
|
NULL
|
NULL
|
|
35136
|
1316
|
2
|
2026-05-13T12:13:50.803905+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674430803_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.38464096,"top":0.17478053,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.17318435,"width":0.00731383,"height":0.018355945},"on_screen":true,"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.40093085,"top":0.17318435,"width":0.006981383,"height":0.018355945},"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"bounds":{"left":0.122340426,"top":0.17158818,"width":0.2855718,"height":0.8284118},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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.40957448,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.41821808,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.42918882,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.43783244,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.44647607,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.4574468,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"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.46841756,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"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.4950133,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.50598407,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.7084442,"top":0.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.67785907,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.69015956,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.6994681,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"}]...
|
-6030343723500956387
|
-7200399789889300129
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35135
|
1315
|
2
|
2026-05-13T12:13:50.803911+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674430803_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4046529603893115453
|
2218881650218382925
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
35134
|
1316
|
1
|
2026-05-13T12:13:47.974844+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674427974_m2.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.38464096,"top":0.17478053,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.17318435,"width":0.00731383,"height":0.018355945},"on_screen":true,"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}]...
|
983806314493535812
|
-8132342958709953598
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
PhostormFV faVsco.js~ViewINavigarecode%9 JY-20891-improve-sms-text-relaProletey© UserInvitationDTO.php© MailboxController.php© NotSupportedException.f© NumberUnavailableExcepTextkelayservice.php© Sso.phpossocontroller.ong© OperationException.php© OutOfBoundsException.pl © TextMessagingService.phpsms-relay-ralled.blade.pnp©smsMessage.png© SmsLength.php© QuotaExceededException© RateLimitException.php© RegistrationInvitationMisn© RequestQueuedForDeferr© ResponseException.phpdeclare(strict_types=1);kingcentralexception.ong© RingCentralExtensionNotfnamespace Jiminny\Http\Controllers\API\TeamInsights;kunumeexception.phg( sequencenumoer-xcepu› use ...(5 servicelnceqration-xcepu© ServiceUnavailableExceptclass DashboardController extends BaseController( SidekickSettinasExceptio( Socia AccountNotFound =24 đ( Socia AccountTokeninvali© SyncActivityException.phTenant solation Exceotion© TextRelayException.phppublic function __construct(Response $response,private readonly ActivitySearch\Service\ActivitySearch $activitySearch,privace readonly leaminstgntskepostcory srepostcoryD 4...F(4TooManvFailedActivities..© TranscriptionNotindexedE(4) UnexoectedCallExceotion33 (0g ›ctl/aoi/viream-insicnts/dasnboaraceaminsiants.aashboarolpublic function fetch(Request $request): JsonResponsef...,© UnexpectedEloquentMod© UnexpectedValueExceptis© ZipAttackException.php? private function getActivity0verTime(User $user, FilterpefinitionCollection $filterSet): array{...}› DD FFMpeg> D Formatsv D Guardsprivate function getCoachingBreakdownBvUserRole(User Suser. Criteria Scriteria): arravS...}l© Sso.php© ViewerGuard.php> D Helpers~ ДHttPprivate function getCoachinaOverTimedUser Suser,Criteria Scriteria.> D AccessTokenProviderv controllers~ DAPI> D AiCallScoring): array f..}AlReports> D Dealinsiahts• Oooortunitvprivate function getEngagementStats(FilterDefinitionCollection $filterSet): array{….}› D PageM Scorecardslusage• M Settinas209private function getCommonTopics(FilterDefinitionCollection $filterSet): arrayf…,v Teaminsiahts© ActivityStatsCor 251(C) CoachinaFeedb:(C) TeaminciahtsAi(5|X1 A v 632633634- vE laravel.logA SF jiminny@localhost]A HS_Jocal [jiminny@localhost]A console (PROD] x& console [EU]A console [STAGING]Tx: AutovORDER BY t.name, calendar domain:liminny040 A1 A40 V 65 ^select * trom users u jo1n calendars c 1<->I.n. on c.user 1d = U.1dwhere u.team_id = 882;select * from activities where id = 74049485: # team 563 crm 53select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * 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;select * from automated_report_results where id = 1976;select * from automated_reports where id = 583;select * from activity_searches where id = 87714;select * from activity_search_filters where activity_search_id = 87714;SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uvid_to_bin(*47842446-af51-4bcb-854f-CC6560290101') = uuid;SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate Zimits:select * from &ated_report_results where gedie type = 'pdf' and status = 2and id IN (18,1872):select * from automated_reports where id = 54;SELECT * FROM users WHERE id IN (24623,29443,29613);SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;select * from text_relays where created_at › '2026-05-01'# and id IN (32415, 32416);and id = 32412;select * from users where team_id = 2 and email like "%scott%' and id = 29510;SELECT * FROM activities WHERE uvid_to_bin('67cebfc2-ed56-44a2-8C68-7a0286ed8618') = uuid; # 79763436Support Daily - 2m left100% L2Wed 13 May 15:13:47U AskJiminnyReportActivityServiceTest vCascadeTrial Owner Role SeleRetactoring User EmaDashboard Activity De+0 ..ThoughtComplete Dashboard Activity Flow1. API Request Entry PointFile: DashboardController-php:33-68bphppublic tunction tetch Request Srequest): Jsonkesponsesuser - schis->getuserr ronkequestisrequesciScriteria = Criteria::createFromRequest(Srequest-sallo. Suser->aetTimezone@)•Scriteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),return Sthis->response->withArray(["widaets! = l'activity-over-time' = Sthis->getActivityOverTime($user, $filterSet),/... other widaetsContext set: CONTEXT_TEAM_ INSIGHTS_ACTIVITY = 'tean-insights-activity'2. Filter Set CreationFile: ActivitySearch.php: 132-244a ohoorivate tunction detteaminsiantsPageFilters(oool SisExoort = talse): FilterderinitioncollectionPoweawlarntaneanlaetanoeoeCollection: :make(lspecial casesFilterDefinition Teaminsiants DateRangeFilter::class.FilterDefinition\TeamInsights\Exists::class,Restrictream::class,RestrictUserGroupScope::classRectrictlicerActive:tclacelregular filtersAsk anvthina (84L)< CodeSWE-16W Windsurf Teams 71:60 UTF-8f 4 spaces...
|
35131
|
NULL
|
NULL
|
NULL
|
|
35133
|
1315
|
1
|
2026-05-13T12:13:47.974866+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674427974_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-7285285044845922623
|
-7200408448544417441
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
1
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}...
|
35132
|
NULL
|
NULL
|
NULL
|
|
35132
|
1315
|
0
|
2026-05-13T12:13:45.975717+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778674425975_m1.jpg...
|
PhpStorm
|
faVsco.js – DashboardController.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
Analyzing…
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
app ~/jiminny/app, folder
.circleci, folder
.cursor, folder
.github
.sonarlint, folder
.vscode, folder
.windsurf, folder
app, sources root
Actions, folder
InviteUserToTeamAction.php, class
MarkUserAsOnboardableAction.php, class
SyncRecordingFlagsAction.php, class
UpdateTeamMemberAction.php, class
UpdateUserRolesAction.php, class
Component
Acl
ActionItems
Activity
ActivityAnalytics
ActivitySearch
EventSubscriber, folder
FilterDefinition, folder
DealInsights, folder
Security, folder
TeamInsights, folder
ActivityActualDate.php
ActivityChannel.php
ActivityDurationRange.php
ActivityFilter.php
ActivityPlaylistIn.php
ActivityProviderIn.php
ActivityRecorded.php
ActivityRecordingStopped.php, final class
ActivityScheduledDate.php, final class
ActivityStatusIn.php, class
ActivityType.php, final class
ActivityUpdatedDate.php, final class
AiCallScoreFilter.php, final class
AutoScoreFilter.php, final class
ClosedDealsFilter.php, final class
CoachingFeedbackAverageScore.php, final class
CoachingFeedbackCoachUserIn.php, final class
CommentCountRange.php, final class
CrmFieldCollection.php, final class
CurrentStage.php, final class
Customer.php, final class...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\API\\TeamInsights;\n\nuse Carbon\\CarbonImmutable;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\nuse Jiminny\\Component\\ActivitySearch;\nuse Jiminny\\Component\\ActivitySearch\\FilterDefinitionCollection;\nuse Jiminny\\Contracts\\ActivitySearch\\ContextAwareFilterDefinitionInterface;\nuse Jiminny\\Http\\Controllers\\API\\BaseController;\nuse Jiminny\\Http\\Responses\\Api\\Response;\nuse Jiminny\\Models;\nuse Jiminny\\Models\\PlaybackTheme\\Topic;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Repositories\\TeamInsightsRepository;\nuse Jiminny\\VO\\Repository\\OnDemandActivitySearch\\Criteria;\n\nclass DashboardController extends BaseController\n{\n public function __construct(\n Response $response,\n private readonly ActivitySearch\\Service\\ActivitySearch $activitySearch,\n private readonly TeamInsightsRepository $repository,\n ) {\n parent::__construct($response);\n\n }\n\n public function fetch(Request $request): JsonResponse\n {\n $user = $this->getUserFromRequest($request);\n\n $criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),\n $user\n );\n\n $request->validate(\n $filterSet->getValidationRules()->all()\n );\n\n $dateTimeRangeStartsAt = $request->has('start_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))\n : null;\n $dateTimeRangeEndsAt = $request->has('end_date')\n ? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))\n : null;\n\n return $this->response->withArray([\n 'filters' => $filterSet->render(),\n 'widgets' => [\n 'activity-over-time' => $this->getActivityOverTime($user, $filterSet),\n 'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),\n 'coaching-over-time' => $this->getCoachingOverTime(\n $user,\n $criteria,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt,\n ),\n 'engagement-stats' => $this->getEngagementStats($filterSet),\n 'common-topics' => $this->getCommonTopics($filterSet),\n ],\n ]);\n }\n\n private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array\n {\n $availableActivityChannels = Collection::make([\n Models\\Activity::TYPE_CONFERENCE,\n Models\\Activity::TYPE_SOFTPHONE,\n Models\\Activity::TYPE_SOFTPHONE_INBOUND,\n Models\\Activity::TYPE_SMS_OUTBOUND,\n ]);\n\n $activityChannels = $availableActivityChannels\n ->flip()\n ->map(static function (): int {\n return 0;\n });\n\n $data = $this->repository->getDashboardActivityOverTime($user, $filterSet)\n ->map(static function (array $data) use ($activityChannels): array {\n return $activityChannels\n ->map(static function (int $defaultValue, string $activityChannel) use ($data): int {\n return $data[$activityChannel] ?? $defaultValue;\n })\n ->values()\n ->all();\n });\n\n return [\n 'labels' => $activityChannels->keys()->all(),\n 'points' => $data->all(),\n ];\n }\n\n private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array\n {\n $listens = $this->repository\n ->getDashboardCoachingBreakdownListensByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n )\n );\n\n $coachingFocusFilled = $this->repository\n ->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(\n $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(\n ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,\n ),\n $user\n )\n );\n\n $data = $listens->mergeRecursive($coachingFocusFilled);\n\n $coachingHimself = $data\n ->map(static function (array $bucket, string $roomOwnerId): int {\n return Collection::make($bucket)\n ->filter(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->sum('count');\n })\n ->sum();\n\n $managerUserRoles = Collection::make(User::MANAGER_ROLES);\n\n $coachingByTeamMembers = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->reject(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n $coachingByManager = $data\n ->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {\n return Collection::make($bucket)\n ->reject(static function (array $userPlays) use ($roomOwnerId): bool {\n return $userPlays['userId'] === $roomOwnerId;\n })\n ->filter(static function (array $userPlays) use ($managerUserRoles): bool {\n return $managerUserRoles\n ->intersect($userPlays['userRoles'])\n ->isNotEmpty();\n })\n ->sum('count');\n })\n ->sum();\n\n return [\n 'self' => $coachingHimself,\n 'team' => $coachingByTeamMembers,\n 'manager' => $coachingByManager,\n ];\n }\n\n private function getCoachingOverTime(\n User $user,\n Criteria $criteria,\n ?CarbonImmutable $dateTimeRangeStartsAt,\n ?CarbonImmutable $dateTimeRangeEndsAt,\n ): array {\n $filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(\n $criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),\n $user\n );\n\n $data = $this->repository->getDashboardCoachingOverTime(\n $user,\n $filterSet,\n $dateTimeRangeStartsAt,\n $dateTimeRangeEndsAt\n )\n ->map(static function (int $value): array {\n return [\n $value,\n ];\n });\n\n return [\n 'labels' => [\n 'coaching-over-time',\n ],\n 'points' => $data->all(),\n ];\n }\n\n private function getEngagementStats(FilterDefinitionCollection $filterSet): array\n {\n return $this->repository->getDashboardEngagementStats($filterSet)->all();\n }\n\n private function getCommonTopics(FilterDefinitionCollection $filterSet): array\n {\n $topics = $this->repository->getCommonTopics($filterSet, 10);\n\n if ($topics->isEmpty()) {\n return [];\n }\n\n // possible improvement: fetch topics from elasticsearch instead\n $map = Topic::query()\n ->whereIn(\n 'uuid',\n $topics->keys()\n ->map(static function (string $id): string {\n return Topic::toOptimized($id);\n })\n ->all()\n )\n ->with('playbackTheme')\n ->get()\n ->keyBy('id_string');\n\n return $topics\n ->filter(static fn (float $count, string $key): bool => $map->has($key))\n ->map(static function (float $count, string $key) use ($map): array {\n /** @var Topic $topic */\n $topic = $map[$key];\n $theme = $topic->getPlaybackTheme();\n\n return [\n 'title' => $topic->getTitle(),\n 'count' => $count,\n 'theme' => [\n 'title' => $theme->getTitle(),\n 'color' => $theme->getColor(),\n ],\n ];\n })\n ->values()\n ->all();\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,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","depth":4,"on_screen":true,"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;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01'\n# and id IN (32415, 32416);\nand id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"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},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app ~/jiminny/app, folder","depth":6,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".circleci, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".cursor, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".github","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".sonarlint, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".vscode, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".windsurf, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"app, sources root","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Actions, folder","depth":8,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"InviteUserToTeamAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MarkUserAsOnboardableAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncRecordingFlagsAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"UpdateTeamMemberAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"UpdateUserRolesAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Component","depth":8,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Acl","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActionItems","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Activity","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityAnalytics","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivitySearch","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"EventSubscriber, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FilterDefinition, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DealInsights, folder","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Security, folder","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"TeamInsights, folder","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityActualDate.php","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityChannel.php","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityDurationRange.php","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityFilter.php","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityPlaylistIn.php","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityProviderIn.php","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityRecorded.php","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityRecordingStopped.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityScheduledDate.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityStatusIn.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityType.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityUpdatedDate.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AiCallScoreFilter.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AutoScoreFilter.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ClosedDealsFilter.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CoachingFeedbackAverageScore.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CoachingFeedbackCoachUserIn.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CommentCountRange.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CrmFieldCollection.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CurrentStage.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Customer.php, final class","depth":11,"on_screen":false,"role_description":"text"}]...
|
-6365011757698063338
|
2218881650218383181
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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
Analyzing…
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\API\TeamInsights;
use Carbon\CarbonImmutable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Jiminny\Component\ActivitySearch;
use Jiminny\Component\ActivitySearch\FilterDefinitionCollection;
use Jiminny\Contracts\ActivitySearch\ContextAwareFilterDefinitionInterface;
use Jiminny\Http\Controllers\API\BaseController;
use Jiminny\Http\Responses\Api\Response;
use Jiminny\Models;
use Jiminny\Models\PlaybackTheme\Topic;
use Jiminny\Models\User;
use Jiminny\Repositories\TeamInsightsRepository;
use Jiminny\VO\Repository\OnDemandActivitySearch\Criteria;
class DashboardController extends BaseController
{
public function __construct(
Response $response,
private readonly ActivitySearch\Service\ActivitySearch $activitySearch,
private readonly TeamInsightsRepository $repository,
) {
parent::__construct($response);
}
public function fetch(Request $request): JsonResponse
{
$user = $this->getUserFromRequest($request);
$criteria = Criteria::createFromRequest($request->all(), $user->getTimezone());
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_ACTIVITY),
$user
);
$request->validate(
$filterSet->getValidationRules()->all()
);
$dateTimeRangeStartsAt = $request->has('start_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('start_date'))
: null;
$dateTimeRangeEndsAt = $request->has('end_date')
? CarbonImmutable::createFromFormat('Y-m-d H:i:s', $request->input('end_date'))
: null;
return $this->response->withArray([
'filters' => $filterSet->render(),
'widgets' => [
'activity-over-time' => $this->getActivityOverTime($user, $filterSet),
'coaching-breakdown' => $this->getCoachingBreakdownByUserRole($user, $criteria),
'coaching-over-time' => $this->getCoachingOverTime(
$user,
$criteria,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt,
),
'engagement-stats' => $this->getEngagementStats($filterSet),
'common-topics' => $this->getCommonTopics($filterSet),
],
]);
}
private function getActivityOverTime(User $user, FilterDefinitionCollection $filterSet): array
{
$availableActivityChannels = Collection::make([
Models\Activity::TYPE_CONFERENCE,
Models\Activity::TYPE_SOFTPHONE,
Models\Activity::TYPE_SOFTPHONE_INBOUND,
Models\Activity::TYPE_SMS_OUTBOUND,
]);
$activityChannels = $availableActivityChannels
->flip()
->map(static function (): int {
return 0;
});
$data = $this->repository->getDashboardActivityOverTime($user, $filterSet)
->map(static function (array $data) use ($activityChannels): array {
return $activityChannels
->map(static function (int $defaultValue, string $activityChannel) use ($data): int {
return $data[$activityChannel] ?? $defaultValue;
})
->values()
->all();
});
return [
'labels' => $activityChannels->keys()->all(),
'points' => $data->all(),
];
}
private function getCoachingBreakdownByUserRole(User $user, Criteria $criteria): array
{
$listens = $this->repository
->getDashboardCoachingBreakdownListensByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
)
);
$coachingFocusFilled = $this->repository
->getDashboardCoachingBreakdownCoachingFocusFilledByUserRole(
$this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(
ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_COACHING_FOCUS_FILLED,
),
$user
)
);
$data = $listens->mergeRecursive($coachingFocusFilled);
$coachingHimself = $data
->map(static function (array $bucket, string $roomOwnerId): int {
return Collection::make($bucket)
->filter(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->sum('count');
})
->sum();
$managerUserRoles = Collection::make(User::MANAGER_ROLES);
$coachingByTeamMembers = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->reject(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
$coachingByManager = $data
->map(static function (array $bucket, string $roomOwnerId) use ($managerUserRoles): int {
return Collection::make($bucket)
->reject(static function (array $userPlays) use ($roomOwnerId): bool {
return $userPlays['userId'] === $roomOwnerId;
})
->filter(static function (array $userPlays) use ($managerUserRoles): bool {
return $managerUserRoles
->intersect($userPlays['userRoles'])
->isNotEmpty();
})
->sum('count');
})
->sum();
return [
'self' => $coachingHimself,
'team' => $coachingByTeamMembers,
'manager' => $coachingByManager,
];
}
private function getCoachingOverTime(
User $user,
Criteria $criteria,
?CarbonImmutable $dateTimeRangeStartsAt,
?CarbonImmutable $dateTimeRangeEndsAt,
): array {
$filterSet = $this->activitySearch->getTeamInsightsPageFilterSet(
$criteria->setContext(ContextAwareFilterDefinitionInterface::CONTEXT_TEAM_INSIGHTS_PLAYBACK),
$user
);
$data = $this->repository->getDashboardCoachingOverTime(
$user,
$filterSet,
$dateTimeRangeStartsAt,
$dateTimeRangeEndsAt
)
->map(static function (int $value): array {
return [
$value,
];
});
return [
'labels' => [
'coaching-over-time',
],
'points' => $data->all(),
];
}
private function getEngagementStats(FilterDefinitionCollection $filterSet): array
{
return $this->repository->getDashboardEngagementStats($filterSet)->all();
}
private function getCommonTopics(FilterDefinitionCollection $filterSet): array
{
$topics = $this->repository->getCommonTopics($filterSet, 10);
if ($topics->isEmpty()) {
return [];
}
// possible improvement: fetch topics from elasticsearch instead
$map = Topic::query()
->whereIn(
'uuid',
$topics->keys()
->map(static function (string $id): string {
return Topic::toOptimized($id);
})
->all()
)
->with('playbackTheme')
->get()
->keyBy('id_string');
return $topics
->filter(static fn (float $count, string $key): bool => $map->has($key))
->map(static function (float $count, string $key) use ($map): array {
/** @var Topic $topic */
$topic = $map[$key];
$theme = $topic->getPlaybackTheme();
return [
'title' => $topic->getTitle(),
'count' => $count,
'theme' => [
'title' => $theme->getTitle(),
'color' => $theme->getColor(),
],
];
})
->values()
->all();
}
}
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
40
1
40
65
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;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01'
# and id IN (32415, 32416);
and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
app ~/jiminny/app, folder
.circleci, folder
.cursor, folder
.github
.sonarlint, folder
.vscode, folder
.windsurf, folder
app, sources root
Actions, folder
InviteUserToTeamAction.php, class
MarkUserAsOnboardableAction.php, class
SyncRecordingFlagsAction.php, class
UpdateTeamMemberAction.php, class
UpdateUserRolesAction.php, class
Component
Acl
ActionItems
Activity
ActivityAnalytics
ActivitySearch
EventSubscriber, folder
FilterDefinition, folder
DealInsights, folder
Security, folder
TeamInsights, folder
ActivityActualDate.php
ActivityChannel.php
ActivityDurationRange.php
ActivityFilter.php
ActivityPlaylistIn.php
ActivityProviderIn.php
ActivityRecorded.php
ActivityRecordingStopped.php, final class
ActivityScheduledDate.php, final class
ActivityStatusIn.php, class
ActivityType.php, final class
ActivityUpdatedDate.php, final class
AiCallScoreFilter.php, final class
AutoScoreFilter.php, final class
ClosedDealsFilter.php, final class
CoachingFeedbackAverageScore.php, final class
CoachingFeedbackCoachUserIn.php, final class
CommentCountRange.php, final class
CrmFieldCollection.php, final class
CurrentStage.php, final class
Customer.php, final class...
|
NULL
|
NULL
|
NULL
|
NULL
|