|
79102
|
2779
|
21
|
2026-05-28T06:18:06.867502+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949086867_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴81DEV (docker)₴2-zsh88311DOCKER (docker-compose)forsync.docker_lamp_1docker_lamp_1docker_1amp_1docker_lamp_1docker_lamp_11s DONE• '/usr/local/bin/php' 'artisan'mailbox:sync > '/proc/1/fd/1' 2>&1run_artisan_schedule: Done waiting for schedule:run2026-05-28 06:16:19 Jiminny\Jobs\Mailbox\SyncInbox.KF.D..... RUNNINGdocker_lamp_12026-05-2806:16:20 Jiminny\Jobs\Mailbox\SyncInbox38.64msDONEdocker_lamp_1docker_lamp_12026-05-28 06:17:01 Running ['artisan' meeting-bot:schedule-bot]... 1s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot > */proc/1/fd/12>&1docker_lamp_1ONEdocker_lamp_12026-05-28 06:17:03 Running ['artisan' dialers:monitor-activities] . 1s D, '/usr/local/bin/php' 'artisan' dialers:monitor-activities > */proc/1/fd/1' 2>81docker_lamp_112026-05-28 06:17:04 Running ['artisan' jiminny:monitor-social-accounts]1S DONEdocker_lamp_1l '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:17:05 Running ['artisan'mailbox:skip-lists:refresh]. 4s DONEdocker_lamp_1/1'1 '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › */proc/1/fd2>&1docker_1amp_12026-05-28 06:17:09 Running ['artisan'mailbox:batch:process --max-batcheS=15]1S DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=15 >'/proc/1/fd/1' 2>&1docker_lamp_1 |2026-05-28 06:17:11 Running ['artisan' mailbox:batch:create]....... ZS DONEdocker_lamp_1" '/usr/local/bin/php' 'artisan'mailbox:batch: create › '/proc/1/fd/1' 2>&1docker_lamp_1docker_1amp_1docker_1amp_1run_artisan_schedule: Done waiting for schedule:run2026-05-28 06:17:17 Jiminny\Jobs\Mailbox\CreateBatchesRUNNINGdocker_lamp_12026-05-28 06:17:17 Jiminny\Jobs\Mailbox\CreateBatches40.19ms DONEdocker_lamp_1 |View in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach100% C47 • Thu 28 May 9:18:06DOCKER (docker-compose)181screenpipe"0 84T2-zsh85...ip-10-30-129-190:~ (nc)886...-10-30-140-255:~ (-zsh)$7XIPROD (ssh)S[URL_WITH_CREDENTIALS] T3 EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)PRODSTAGEX T6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDEXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [EXTENSION...
|
NULL
|
-8771798769352793517
|
NULL
|
visual_change
|
ocr
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴81DEV (docker)₴2-zsh88311DOCKER (docker-compose)forsync.docker_lamp_1docker_lamp_1docker_1amp_1docker_lamp_1docker_lamp_11s DONE• '/usr/local/bin/php' 'artisan'mailbox:sync > '/proc/1/fd/1' 2>&1run_artisan_schedule: Done waiting for schedule:run2026-05-28 06:16:19 Jiminny\Jobs\Mailbox\SyncInbox.KF.D..... RUNNINGdocker_lamp_12026-05-2806:16:20 Jiminny\Jobs\Mailbox\SyncInbox38.64msDONEdocker_lamp_1docker_lamp_12026-05-28 06:17:01 Running ['artisan' meeting-bot:schedule-bot]... 1s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot > */proc/1/fd/12>&1docker_lamp_1ONEdocker_lamp_12026-05-28 06:17:03 Running ['artisan' dialers:monitor-activities] . 1s D, '/usr/local/bin/php' 'artisan' dialers:monitor-activities > */proc/1/fd/1' 2>81docker_lamp_112026-05-28 06:17:04 Running ['artisan' jiminny:monitor-social-accounts]1S DONEdocker_lamp_1l '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:17:05 Running ['artisan'mailbox:skip-lists:refresh]. 4s DONEdocker_lamp_1/1'1 '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › */proc/1/fd2>&1docker_1amp_12026-05-28 06:17:09 Running ['artisan'mailbox:batch:process --max-batcheS=15]1S DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=15 >'/proc/1/fd/1' 2>&1docker_lamp_1 |2026-05-28 06:17:11 Running ['artisan' mailbox:batch:create]....... ZS DONEdocker_lamp_1" '/usr/local/bin/php' 'artisan'mailbox:batch: create › '/proc/1/fd/1' 2>&1docker_lamp_1docker_1amp_1docker_1amp_1run_artisan_schedule: Done waiting for schedule:run2026-05-28 06:17:17 Jiminny\Jobs\Mailbox\CreateBatchesRUNNINGdocker_lamp_12026-05-28 06:17:17 Jiminny\Jobs\Mailbox\CreateBatches40.19ms DONEdocker_lamp_1 |View in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach100% C47 • Thu 28 May 9:18:06DOCKER (docker-compose)181screenpipe"0 84T2-zsh85...ip-10-30-129-190:~ (nc)886...-10-30-140-255:~ (-zsh)$7XIPROD (ssh)S[URL_WITH_CREDENTIALS] T3 EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)PRODSTAGEX T6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDEXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [EXTENSION...
|
79094
|
NULL
|
NULL
|
NULL
|
|
79103
|
2780
|
29
|
2026-05-28T06:18:06.928524+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949086928_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
=unpstomViewCoocKelucioWindowFV faVsco.|s ~$ JY-20 =unpstomViewCoocKelucioWindowFV faVsco.|s ~$ JY-20915-fix-missing-header-texterenv.roo= .env.staging=.gitattributes.gitignore.php-cs-fixer.cache"wrono-es"hixer.oistonphp.phpstorm.meta.php.phounit.result.cacheprettierignore.windsurfruleswp idenelper.ongnp ide nelper models.onc© SyncMailbox.phpTextRelayServiceTest.phpclass TextRelayServiceouoere Tuncczon syne diidDockerfilecustom.loglaravel.logSF (iminny@localhost) x HS.Jocal jminny@alocalhostconedia Pere# consolefFul.env.productionconsole (STAGINGE 41417 A YD8.00€Tc AutoSEE * FRO% actutes where status e "tarledsMACLAUDE.mocomposer..soncomposer.lockdependency-checker.isondev.isonE ids.tx:einkecon.ison.dieMaNSALumMNHERNALWE:H005a102me=liminny storacewllicenses.maMwakenenactanesack sonE phpstan.neon.distnhnstan-haseline.neo.<$ phpunit.xmlT raw_sqLquery.saMUREADME mo{3 sonar-project.propertiestest.py<> Untitled Diagram.xmlosvetur.confia.iMWCOUOOK GILTGOING INOIGUIZUTAT> 1 External LibrariesNSUCAMAhIT ANX CAAAhv l Database ConsolesV AEUA console (EU)A DEAL RISKS (EU"#OITEUAEU (EUTv#liminnveloca nostoriminnyiolocalhost4HS.local fliminnw@localhostostiminouallocal noshlzohd dav tim nowedes moshlconsole ic?ooiSnailbox = config( key: "1minny.google_text_user ):230SexpectedAlias = config( key: ""iminny«deploy_region") === 'eu" ? 'catch-all-eu' : catch-all':231SexpectedHost = config( key: ""iminny-google_text_host'):232Log::info( message: '[TextRelayService) Starting sync', L'mailbox' => Snailbox"exрестoo deros з зexpecreonezos"ехрество поли в зехрестеоновсиDASservice = Sthis->getService(Snaflbox);aessacchSorohSooethorteiVlluninate|Support\Facades\Log::channel ( channet: "custon-channel')->info(*SnessageHistorySnessaoelds =U5243Toreach Smessagertstory as Shistontes)Smessages = Shistonies-›nessagesAdded 22 0:240foreach (Smessages as Snessage)Smessageld= Snessage->nessage.>c—248249259if (: Sthis->isForcurrentenvironment(Sservice, Snailbox, Smessageid, SexpectedAlias, Sexpel,sяSrelayedText = TextRelay::wherel c'enail_provider_id', Smessageld)->firstO:taalavadtayt e= ouhbSrelayedText = TextRelay::createll'email_provider' => TextRelay::PROVIDER_6SUITE'email_provider_id' => Smessageld'status" => TextRelay::STATUS_PROCESSING259259261Siob = new Enail TextRelav(Smessageld. SrelavedText):Siob->onQueue queud=264269264Loo:sinfo( message: "[TextRelavServicel Successfully dispatched nessage'. "l'message id' => Snessaceidltext relay d a> Srelavedtexto>id'queue' => Constants::QUEUS EMATLSicting the dictionaries for other lanquages. (yesterday 15:44)Do jminnyURBIBIYLYOASEE * FROX TrACKS WHERE aCCOVITY 10 = 4422883SELENa.*hon scaiwidiesJOIN users u 1.n<->1: ON a.user_id = u.2oa.status = 'conpleted'AND uuid_to_bin(*641flacb-16b8-42d1-8726-df52979dadbe') = u.uuioAND a.deleted_at IS NULLSELECT 1 FROM tracks tWHERE t.activity id = a.ioAND t.type IN ('audio','video')ORDER BY a.actual start time DESCLIMIT 25:select * fron teans where 1d = 19;select * fron con configuratsions where orovider = 'pinednive':SELECTCONCATCU,1d. CASE WHEM U,id = trounen id THEN • (oaner)• ELSE ** END) AS usen 1dthounen id FROM sochial accounts s.Mo usens u on u.d = sarsoctablesidJOIN teans t 1.n<->1: on t.id = u.tean_icWHERE u.tean_id = 19 and sa.provider = 'pipedosve':SELECT * EROM social accounte WHERE $d = 1116÷UPiAis socinl accounte Sel provider usen token = *yiu:A08AH1-12Nk2yuuunLohfzhWb9crUMknk4=.09cinXo0 6AEchthDOVarinwcHEynanouiidon cofrosh tokon = 15934113:19555731:87c14258f0c8130827676697Sf6844đ46b6b2bfc*,exoiines 3 1729891997state = 'connected"provider user token": "viu:AQIBAH)-LzTNK2yuuuaLqifzh#b9crUNKTpk«F109rjnXop6AE0hDhDQVa1nviCHEvnpvSEAAAAf:B88gkqhkJ69w8BBw*"provider_refresh_token": "5034113:1955S731:87c14258f0c813d02767ee975f6044d46b6b2bfc*,SoyniAAer: 1779831997Colont & EnAn An eiolai volmodselect * fron crn fieldsselect * tron crn contzouStatementscalont " rom cim hoidcciEor aid punrid enstual cfart time didlaNuctAmisTOOУ L7Thu 28 May 9:18:06TextRelayServiceTestaer henseict+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the sunc manualiv vin tinker tinside docker 1aeo 1%b bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and dispatches jobs to the queue. If you don't want it to actuallsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironntioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(som Serviceassvc-soctServicelcontiatainny.googletextI then sinsoect a eessade canual1sasg= sonailService-susers_messages-sget(config(*iminty.google text user'), *THE_MESSAGE ID')collect(5-s0-20etPayload()-soetWeaders())-soluck("value"thut wey von can Mrity what handare tra nehhilm oraesot do ttat macesos alote tha ull evoc muneAck amthine (oL¿ &eiaCAhantiv• CNU MMad Tosme2one litee...
|
NULL
|
3286897497944638623
|
NULL
|
typing_pause
|
ocr
|
NULL
|
=unpstomViewCoocKelucioWindowFV faVsco.|s ~$ JY-20 =unpstomViewCoocKelucioWindowFV faVsco.|s ~$ JY-20915-fix-missing-header-texterenv.roo= .env.staging=.gitattributes.gitignore.php-cs-fixer.cache"wrono-es"hixer.oistonphp.phpstorm.meta.php.phounit.result.cacheprettierignore.windsurfruleswp idenelper.ongnp ide nelper models.onc© SyncMailbox.phpTextRelayServiceTest.phpclass TextRelayServiceouoere Tuncczon syne diidDockerfilecustom.loglaravel.logSF (iminny@localhost) x HS.Jocal jminny@alocalhostconedia Pere# consolefFul.env.productionconsole (STAGINGE 41417 A YD8.00€Tc AutoSEE * FRO% actutes where status e "tarledsMACLAUDE.mocomposer..soncomposer.lockdependency-checker.isondev.isonE ids.tx:einkecon.ison.dieMaNSALumMNHERNALWE:H005a102me=liminny storacewllicenses.maMwakenenactanesack sonE phpstan.neon.distnhnstan-haseline.neo.<$ phpunit.xmlT raw_sqLquery.saMUREADME mo{3 sonar-project.propertiestest.py<> Untitled Diagram.xmlosvetur.confia.iMWCOUOOK GILTGOING INOIGUIZUTAT> 1 External LibrariesNSUCAMAhIT ANX CAAAhv l Database ConsolesV AEUA console (EU)A DEAL RISKS (EU"#OITEUAEU (EUTv#liminnveloca nostoriminnyiolocalhost4HS.local fliminnw@localhostostiminouallocal noshlzohd dav tim nowedes moshlconsole ic?ooiSnailbox = config( key: "1minny.google_text_user ):230SexpectedAlias = config( key: ""iminny«deploy_region") === 'eu" ? 'catch-all-eu' : catch-all':231SexpectedHost = config( key: ""iminny-google_text_host'):232Log::info( message: '[TextRelayService) Starting sync', L'mailbox' => Snailbox"exрестoo deros з зexpecreonezos"ехрество поли в зехрестеоновсиDASservice = Sthis->getService(Snaflbox);aessacchSorohSooethorteiVlluninate|Support\Facades\Log::channel ( channet: "custon-channel')->info(*SnessageHistorySnessaoelds =U5243Toreach Smessagertstory as Shistontes)Smessages = Shistonies-›nessagesAdded 22 0:240foreach (Smessages as Snessage)Smessageld= Snessage->nessage.>c—248249259if (: Sthis->isForcurrentenvironment(Sservice, Snailbox, Smessageid, SexpectedAlias, Sexpel,sяSrelayedText = TextRelay::wherel c'enail_provider_id', Smessageld)->firstO:taalavadtayt e= ouhbSrelayedText = TextRelay::createll'email_provider' => TextRelay::PROVIDER_6SUITE'email_provider_id' => Smessageld'status" => TextRelay::STATUS_PROCESSING259259261Siob = new Enail TextRelav(Smessageld. SrelavedText):Siob->onQueue queud=264269264Loo:sinfo( message: "[TextRelavServicel Successfully dispatched nessage'. "l'message id' => Snessaceidltext relay d a> Srelavedtexto>id'queue' => Constants::QUEUS EMATLSicting the dictionaries for other lanquages. (yesterday 15:44)Do jminnyURBIBIYLYOASEE * FROX TrACKS WHERE aCCOVITY 10 = 4422883SELENa.*hon scaiwidiesJOIN users u 1.n<->1: ON a.user_id = u.2oa.status = 'conpleted'AND uuid_to_bin(*641flacb-16b8-42d1-8726-df52979dadbe') = u.uuioAND a.deleted_at IS NULLSELECT 1 FROM tracks tWHERE t.activity id = a.ioAND t.type IN ('audio','video')ORDER BY a.actual start time DESCLIMIT 25:select * fron teans where 1d = 19;select * fron con configuratsions where orovider = 'pinednive':SELECTCONCATCU,1d. CASE WHEM U,id = trounen id THEN • (oaner)• ELSE ** END) AS usen 1dthounen id FROM sochial accounts s.Mo usens u on u.d = sarsoctablesidJOIN teans t 1.n<->1: on t.id = u.tean_icWHERE u.tean_id = 19 and sa.provider = 'pipedosve':SELECT * EROM social accounte WHERE $d = 1116÷UPiAis socinl accounte Sel provider usen token = *yiu:A08AH1-12Nk2yuuunLohfzhWb9crUMknk4=.09cinXo0 6AEchthDOVarinwcHEynanouiidon cofrosh tokon = 15934113:19555731:87c14258f0c8130827676697Sf6844đ46b6b2bfc*,exoiines 3 1729891997state = 'connected"provider user token": "viu:AQIBAH)-LzTNK2yuuuaLqifzh#b9crUNKTpk«F109rjnXop6AE0hDhDQVa1nviCHEvnpvSEAAAAf:B88gkqhkJ69w8BBw*"provider_refresh_token": "5034113:1955S731:87c14258f0c813d02767ee975f6044d46b6b2bfc*,SoyniAAer: 1779831997Colont & EnAn An eiolai volmodselect * fron crn fieldsselect * tron crn contzouStatementscalont " rom cim hoidcciEor aid punrid enstual cfart time didlaNuctAmisTOOУ L7Thu 28 May 9:18:06TextRelayServiceTestaer henseict+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the sunc manualiv vin tinker tinside docker 1aeo 1%b bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and dispatches jobs to the queue. If you don't want it to actuallsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironntioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(som Serviceassvc-soctServicelcontiatainny.googletextI then sinsoect a eessade canual1sasg= sonailService-susers_messages-sget(config(*iminty.google text user'), *THE_MESSAGE ID')collect(5-s0-20etPayload()-soetWeaders())-soluck("value"thut wey von can Mrity what handare tra nehhilm oraesot do ttat macesos alote tha ull evoc muneAck amthine (oL¿ &eiaCAhantiv• CNU MMad Tosme2one litee...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79104
|
2780
|
30
|
2026-05-28T06:18:10.495181+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949090495_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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.37666222,"top":0.10055866,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","depth":4,"bounds":{"left":0.38597074,"top":0.10055866,"width":0.00930851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39694148,"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.40425533,"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\\Services\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.49833778,"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":"Playground","depth":4,"bounds":{"left":0.5093085,"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.7237367,"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":"21","depth":4,"bounds":{"left":0.6868351,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
2193911177781108814
|
6830303738833801805
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79103
|
NULL
|
NULL
|
NULL
|
|
79105
|
NULL
|
0
|
2026-05-28T06:18:13.599992+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949093599_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
Project
Project
New File or Directory…...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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.37666222,"top":0.10055866,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","depth":4,"bounds":{"left":0.38597074,"top":0.10055866,"width":0.00930851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39694148,"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.40425533,"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\\Services\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"21","depth":4,"bounds":{"left":0.6868351,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
-8898301427865847658
|
6830304288589648461
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
Project
Project
New File or Directory…...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79106
|
NULL
|
0
|
2026-05-28T06:18:17.051690+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949097051_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"AXStaticText","text":"17","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\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"21","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
2193911177781108814
|
6830303738833801805
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79107
|
2782
|
0
|
2026-05-28T06:18:19.704738+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949099704_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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.37666222,"top":0.10055866,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","depth":4,"bounds":{"left":0.38597074,"top":0.10055866,"width":0.00930851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39694148,"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.40425533,"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\\Services\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Services\\Mail;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Support\\Facades\\Log;\nuse Jiminny\\Component\\Queue\\Constants;\nuse Jiminny\\Jobs\\Mailbox\\EmailTextRelay;\nuse Jiminny\\Models\\TextRelay;\nuse Google\\Service\\Gmail as GoogleGmail;\n\nclass TextRelayService\n{\n public function __construct()\n {\n $credentials = storage_path('text-relay.json');\n\n abort_unless(file_exists($credentials), 422);\n\n putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);\n }\n\n /**\n * Fetch the latest messages since the last sync.\n */\n public function sync(): array\n {\n $mailbox = config('jiminny.google_text_user');\n\n $expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';\n $expectedHost = config('jiminny.google_text_host');\n\n Log::info('[TextRelayService] Starting sync', [\n 'mailbox' => $mailbox,\n 'expected_alias' => $expectedAlias,\n 'expected_host' => $expectedHost,\n ]);\n\n $service = $this->getService($mailbox);\n\n $messageHistory = $this->getHistory($service);\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));\n $messageIds = [];\n\n foreach ($messageHistory as $histories) {\n $messages = $histories->messagesAdded ?? [];\n\n foreach ($messages as $message) {\n $messageId = $message->message->id;\n\n if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {\n continue;\n }\n\n $relayedText = TextRelay::where('email_provider_id', $messageId)->first();\n\n if ($relayedText === null) {\n $relayedText = TextRelay::create([\n 'email_provider' => TextRelay::PROVIDER_GSUITE,\n 'email_provider_id' => $messageId,\n 'status' => TextRelay::STATUS_PROCESSING,\n ]);\n }\n\n $job = new EmailTextRelay($messageId, $relayedText);\n $job->onQueue(Constants::QUEUE_EMAILS);\n\n// dispatch($job);\n\n Log::info('[TextRelayService] Successfully dispatched message', [\n 'message_id' => $messageId,\n 'text_relay_id' => $relayedText->id,\n 'queue' => Constants::QUEUE_EMAILS,\n ]);\n\n $messageIds[] = $messageId;\n }\n }\n\n Log::info('[TextRelayService] Sync completed', [\n 'mailbox' => $mailbox,\n 'messages_processed' => count($messageIds),\n 'message_ids' => array_slice($messageIds, 0, 10),\n ]);\n\n return $messageIds;\n }\n\n public function getHistory(GoogleGmail $service): array\n {\n $pageToken = null;\n $topic = config('jiminny.google_text_relay_topic');\n $messages = [];\n $historyId = \\Cache::get($topic);\n\n // If we have no history stored, WatchMailboxEvents must not have run yet :/\n if ($historyId == false) {\n $historyId = $this->refreshHistoryPoint($topic);\n }\n\n $params = [\n 'historyTypes' => 'messageAdded',\n 'startHistoryId' => $historyId,\n ];\n\n do {\n try {\n if ($pageToken) {\n $params['pageToken'] = $pageToken;\n }\n \\Illuminate\\Support\\Facades\\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));\n\n $historyResponse = $service->users_history->listUsersHistory(\n config('jiminny.google_text_user'),\n $params\n );\n\n $this->setHistoryPoint($topic, (int) $historyResponse->historyId);\n\n if ($historyResponse->getHistory()) {\n $messages = array_merge($messages, $historyResponse->getHistory());\n $pageToken = $historyResponse->getNextPageToken();\n }\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to fetch Gmail history', [\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n } while ($pageToken);\n\n return $messages;\n }\n\n protected function setHistoryPoint(string $topic, int $historyPoint): Carbon\n {\n $expiresAt = now()->addDay();\n\n \\Cache::put($topic, $historyPoint, $expiresAt);\n\n return $expiresAt;\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n $client = new \\Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope(GoogleGmail::GMAIL_MODIFY);\n $client->setAccessType('offline');\n $client->setSubject($mailbox);\n\n return new GoogleGmail($client);\n }\n\n public function refreshHistoryPoint(string $topic): int\n {\n $mailbox = config('jiminny.google_text_user');\n $service = $this->getService($mailbox);\n\n $watchRequest = new GoogleGmail\\WatchRequest();\n $watchRequest->setLabelIds(['INBOX']);\n $watchRequest->setLabelFilterAction('include');\n $watchRequest->setTopicName($topic);\n\n $watchResponse = $service->users->watch($mailbox, $watchRequest);\n\n //$expiryTimestamp = $watchResponse->expiration / 1000;\n $historyPoint = (int) $watchResponse->historyId;\n\n $this->setHistoryPoint($topic, $historyPoint);\n\n return $historyPoint;\n }\n\n private function isForCurrentEnvironment(\n GoogleGmail $service,\n string $mailbox,\n string $messageId,\n string $expectedAlias,\n string $expectedHost\n ): bool {\n try {\n $message = $service->users_messages->get($mailbox, $messageId);\n $headers = $message->getPayload()->getHeaders();\n\n foreach ($headers as $header) {\n if ($header->name === 'X-Gm-Original-To') {\n $matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);\n\n if (! $matches) {\n // Sanitize PII by removing plus-tag content for logging\n $sanitizedOriginalTo = explode('+', $header->value)[0];\n Log::info('[TextRelayService] Refused message', [\n 'message_id' => $messageId,\n 'original_to_sanitized' => $sanitizedOriginalTo,\n ]);\n }\n\n return $matches;\n }\n }\n\n Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [\n 'message_id' => $messageId,\n ]);\n } catch (\\Exception $e) {\n Log::error('[TextRelayService] Failed to inspect message', [\n 'message_id' => $messageId,\n 'exception' => $e->getMessage(),\n ]);\n \\Sentry::captureException($e);\n }\n\n return false;\n }\n\n private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool\n {\n $parts = explode('@', $recipient, 2);\n\n if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {\n return false;\n }\n\n $localBase = explode('+', $parts[0], 2)[0];\n\n return strcasecmp($localBase, $expectedAlias) === 0;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"21","depth":4,"bounds":{"left":0.6868351,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
2193911177781108814
|
6830303738833801805
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Code changed:
Hide
Sync Changes
Hide This Notification
1
17
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Mail;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Jiminny\Component\Queue\Constants;
use Jiminny\Jobs\Mailbox\EmailTextRelay;
use Jiminny\Models\TextRelay;
use Google\Service\Gmail as GoogleGmail;
class TextRelayService
{
public function __construct()
{
$credentials = storage_path('text-relay.json');
abort_unless(file_exists($credentials), 422);
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $credentials);
}
/**
* Fetch the latest messages since the last sync.
*/
public function sync(): array
{
$mailbox = config('jiminny.google_text_user');
$expectedAlias = config('jiminny.deploy_region') === 'eu' ? 'catch-all-eu' : 'catch-all';
$expectedHost = config('jiminny.google_text_host');
Log::info('[TextRelayService] Starting sync', [
'mailbox' => $mailbox,
'expected_alias' => $expectedAlias,
'expected_host' => $expectedHost,
]);
$service = $this->getService($mailbox);
$messageHistory = $this->getHistory($service);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$messageHistory ' . PHP_EOL . print_r($messageHistory, true));
$messageIds = [];
foreach ($messageHistory as $histories) {
$messages = $histories->messagesAdded ?? [];
foreach ($messages as $message) {
$messageId = $message->message->id;
if (! $this->isForCurrentEnvironment($service, $mailbox, $messageId, $expectedAlias, $expectedHost)) {
continue;
}
$relayedText = TextRelay::where('email_provider_id', $messageId)->first();
if ($relayedText === null) {
$relayedText = TextRelay::create([
'email_provider' => TextRelay::PROVIDER_GSUITE,
'email_provider_id' => $messageId,
'status' => TextRelay::STATUS_PROCESSING,
]);
}
$job = new EmailTextRelay($messageId, $relayedText);
$job->onQueue(Constants::QUEUE_EMAILS);
// dispatch($job);
Log::info('[TextRelayService] Successfully dispatched message', [
'message_id' => $messageId,
'text_relay_id' => $relayedText->id,
'queue' => Constants::QUEUE_EMAILS,
]);
$messageIds[] = $messageId;
}
}
Log::info('[TextRelayService] Sync completed', [
'mailbox' => $mailbox,
'messages_processed' => count($messageIds),
'message_ids' => array_slice($messageIds, 0, 10),
]);
return $messageIds;
}
public function getHistory(GoogleGmail $service): array
{
$pageToken = null;
$topic = config('jiminny.google_text_relay_topic');
$messages = [];
$historyId = \Cache::get($topic);
// If we have no history stored, WatchMailboxEvents must not have run yet :/
if ($historyId == false) {
$historyId = $this->refreshHistoryPoint($topic);
}
$params = [
'historyTypes' => 'messageAdded',
'startHistoryId' => $historyId,
];
do {
try {
if ($pageToken) {
$params['pageToken'] = $pageToken;
}
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$params ' . PHP_EOL . print_r($params, true));
$historyResponse = $service->users_history->listUsersHistory(
config('jiminny.google_text_user'),
$params
);
$this->setHistoryPoint($topic, (int) $historyResponse->historyId);
if ($historyResponse->getHistory()) {
$messages = array_merge($messages, $historyResponse->getHistory());
$pageToken = $historyResponse->getNextPageToken();
}
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to fetch Gmail history', [
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
} while ($pageToken);
return $messages;
}
protected function setHistoryPoint(string $topic, int $historyPoint): Carbon
{
$expiresAt = now()->addDay();
\Cache::put($topic, $historyPoint, $expiresAt);
return $expiresAt;
}
public function getService(string $mailbox): GoogleGmail
{
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(GoogleGmail::GMAIL_MODIFY);
$client->setAccessType('offline');
$client->setSubject($mailbox);
return new GoogleGmail($client);
}
public function refreshHistoryPoint(string $topic): int
{
$mailbox = config('jiminny.google_text_user');
$service = $this->getService($mailbox);
$watchRequest = new GoogleGmail\WatchRequest();
$watchRequest->setLabelIds(['INBOX']);
$watchRequest->setLabelFilterAction('include');
$watchRequest->setTopicName($topic);
$watchResponse = $service->users->watch($mailbox, $watchRequest);
//$expiryTimestamp = $watchResponse->expiration / 1000;
$historyPoint = (int) $watchResponse->historyId;
$this->setHistoryPoint($topic, $historyPoint);
return $historyPoint;
}
private function isForCurrentEnvironment(
GoogleGmail $service,
string $mailbox,
string $messageId,
string $expectedAlias,
string $expectedHost
): bool {
try {
$message = $service->users_messages->get($mailbox, $messageId);
$headers = $message->getPayload()->getHeaders();
foreach ($headers as $header) {
if ($header->name === 'X-Gm-Original-To') {
$matches = $this->matchesExpectedRecipient($header->value, $expectedAlias, $expectedHost);
if (! $matches) {
// Sanitize PII by removing plus-tag content for logging
$sanitizedOriginalTo = explode('+', $header->value)[0];
Log::info('[TextRelayService] Refused message', [
'message_id' => $messageId,
'original_to_sanitized' => $sanitizedOriginalTo,
]);
}
return $matches;
}
}
Log::warning('[TextRelayService] Refused message: missing X-Gm-Original-To header', [
'message_id' => $messageId,
]);
} catch (\Exception $e) {
Log::error('[TextRelayService] Failed to inspect message', [
'message_id' => $messageId,
'exception' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return false;
}
private function matchesExpectedRecipient(string $recipient, string $expectedAlias, string $expectedHost): bool
{
$parts = explode('@', $recipient, 2);
if (count($parts) !== 2 || strcasecmp($parts[1], $expectedHost) !== 0) {
return false;
}
$localBase = explode('+', $parts[0], 2)[0];
return strcasecmp($localBase, $expectedAlias) === 0;
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79105
|
NULL
|
NULL
|
NULL
|
|
79134
|
2781
|
12
|
2026-05-28T06:19:30.170691+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949170170_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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}]...
|
1450156160936216385
|
5771048317937760189
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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...
|
79130
|
NULL
|
NULL
|
NULL
|
|
79135
|
2782
|
15
|
2026-05-28T06:19:30.273408+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949170273_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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}]...
|
-7228688528716742632
|
2609222811515291121
|
typing_pause
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
PhpStormViewCootRurTool:WindowFV faVsco.|s ~%0tv-mnotC.themieein.hasdor.tort.rola© SyncMailbox.phpMockeriitEinfection ison distTextRelayServiceTest.phpphp fiminny.phpclass Field extends ModelMANiStNAwERtosanemaiimiony storaceuse RequiresUUID.use Enums:MMakerd0 package-lock.jsonnhnetan naon dietE phpstan-baseline.ncon<>phpunit.xmlBraw.sal.query.soMAPCAOMS mafê sonar-proiect-propertiosEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWICONDAY CITZONG IMORNZUTAYpublic const int NAME_ MAXLENGTH = 128:public const int LABEL_MAX_LENGTH = 255;usaoesoublic const sint DESCRIPTION MAXLENGTH = 191public const string TYPE_MULTIPICKLISI = 'nulti-picklist':I/ Not vet supported> 1h Extemal Librariesv Eg Scratches and Consolesv E Database Consolesconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowsoes roeAN fiiminovAlocalbostwsweslitiiminowoesnnehASE fliminnvAlocslboett58888822283888oubliie const stoing TYPE PERCENToercentoub dic const strind tpe prikastiockuistoublie constnuhilse conetnuhilse conetstring TYPE_BOOLEAXnuhllsie conetetaneivprtiseipublic const string VYPE_VEXTAREAnuhllse conetstring TYPE_EMALLpublic conststring TYPE_PHONEpublic conststring TYPE_URLpublic const string TYPE_DATEpublic constetainn YVpg YYMdpublic const string TYPE DATETIMEetrina YVOS HINGHDONOYEN = HИNGUnЛANtOREgohdca tiimdowhesnaelmuhlin conct ctainn MRIser nugan• Аpроnnuhlin conct ctainn MRISeY ACColiNnIconcals ropontServico,+o₫7) OutputRetnes Aem talktv MDatabas,V AEUA consoleДid T1-500y 01.501500ialuusd uiTd Tith toeclonal9 Me conficuration.id v,а@AAe An crn provider id M73 e12ed2f6-f2f4-46dc-9c7f-ac2cad34beft3 Subfectyliminny@loch nost74 [CREDIT_CARD]-6634-23ed2fcdaace3 Desccintion#SESoA HSLlocal26 @obfed0h-LANL-l9ShchGAn-2161oCmr10176 c7d7df3b-27c8-4424-8519-0a3c63a2df9022 609/6114.K0hh.1Onh,OhZAAhAGehnaEAd3 Priority3 ActivityDate3 TypeNCTACINC20 1106AALO, E0HAHIOAZ, PAEA,DКIЛANAEÇЛООrancalo7 SuonectTnastor79 6181feSc-4d97-4b6c-h001-f6eS9c19c837Xltesentorton80 4e1/0c50-Ac3a-49a9-h9a5-a21ab96996963Starthate sine815hREn5h4-C/29-1286-9036-2626960666673EndhateTneON MOROZINGISAARIOOA OAGE IONARANAAGT4 TypesravellosSF (iminny@localhost) xHS Jocal jiminny@blocalhostconsole [PROD)# console FulA console (STAGINGTwwAV252255=260= 261=268269Tc AutoDo jminny021 A1 A18 V2 V6 Asetece * fron con_contzguracions where provzder = "Pipedneve":12421CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE "* END) AS user_iduhensasa.*t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idMoniM teans+1..n<->1: on t.id = u.tean_igWHERE u.tean_id = 19 and sa.provider = 'pipedcive':SELECT * FROM social accounts WHERE id = 1116;UPDATE social accounts SET provider user token = *vlu:AQIBAH)-LzTNK2yuuuaLqifzhWb9crUNKTpk4FL09rjnXqp 6AЕQhDhDQVa1nviCHEvnp'provider refresh token = 5034113:[TELEGRAM_TOKEN]b2bfc'CApAICS- S11Y0Y2771WHERE 1d = 1116:"provider user token": "viu:AQIBAH"-LzTNK2yuuuaLq{fzh#b9crUNKTpk4F109rjnXop_6AE0hDhDQVa1nviCHEvnpvSEAAAAf$B8Bqkqhkd69BBВи:"provider refresh token": "5034113:[TELEGRAM_TOKEN]b2bfc"exozres. 171Y892997Selec * tron crn tzelo valuesselect * fron crn fields and;:m)labelSubsectparanttDueActivity TypeSubfeconmentStartFndlActivity Typeim description mMhat wie vou follon uo ontHow ungent is it:When is the activity due?Please selectWhat 4ll you follon up on?cnuteWhen watthe actavity start?When should the activity end?OWAeCAinANm) typeTextpicklistdatepicklisttexteyaredatetsinedatetaneAALKAtB lengthim default value‹null> ‹nulesnull> <nutt»cnull> null:<null <nullsnull <nullconls coutcoulls coullsTOOУ L7Thu 28 May 9:19:30TextRelayServiceTestner hensewiet+0.can I test it locally first. if I place env from stagingYes, The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10lb bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnantorectly via tinker to veriry the header loaic without disoatchina amvthinotioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthino (2a1§ AdaptiveCSVyДus.00am obsect type yAm) is selectable "in is mandatoryAm) is filterableTaskaskotasktaskeventeveneventeventMnleur Tosmensa....
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79136
|
2781
|
13
|
2026-05-28T06:19:32.732885+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949172732_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = ;
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"22","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = ;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = ;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
-2020755039102989464
|
6685203931303450205
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = ;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79137
|
2782
|
16
|
2026-05-28T06:19:32.833934+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949172833_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = ;
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"22","depth":4,"bounds":{"left":0.68650264,"top":0.123703115,"width":0.009973404,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = ;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = ;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
-2020755039102989464
|
6685203931303450205
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = ;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79135
|
NULL
|
NULL
|
NULL
|
|
79138
|
2781
|
14
|
2026-05-28T06:19:33.857715+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949173857_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = '';
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"22","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = '';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = '';","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
1042610928031870014
|
6685203931303450205
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = '';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79136
|
NULL
|
NULL
|
NULL
|
|
79139
|
2782
|
17
|
2026-05-28T06:19:34.909241+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949174909_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"22","depth":4,"bounds":{"left":0.68650264,"top":0.123703115,"width":0.009973404,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
6470106462103707192
|
6685203931303450205
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79140
|
2781
|
15
|
2026-05-28T06:19:36.262877+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949176262_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":false,"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":true,"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":"22","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","depth":3,"on_screen":true,"value":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","role_description":"text field","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}]...
|
9162882854999588165
|
6685203931857098333
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79141
|
2782
|
18
|
2026-05-28T06:19:37.063409+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949177063_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"22","depth":4,"bounds":{"left":0.68650264,"top":0.123703115,"width":0.009973404,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","depth":3,"bounds":{"left":0.41156915,"top":0.6217079,"width":0.3257979,"height":0.027134877},"on_screen":true,"value":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","role_description":"text field","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}]...
|
9162882854999588165
|
6685203931857098333
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79139
|
NULL
|
NULL
|
NULL
|
|
79142
|
2781
|
16
|
2026-05-28T06:19:38.039039+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949178039_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"22","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields and type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-5340445167498385164
|
6685203931320227421
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields and type = 'multi-picklist';...
|
79140
|
NULL
|
NULL
|
NULL
|
|
79143
|
2781
|
17
|
2026-05-28T06:19:39.958016+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949179958_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"22","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","depth":3,"on_screen":true,"value":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","role_description":"text field","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}]...
|
-5836513839804454374
|
6685203931840321117
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79144
|
2782
|
19
|
2026-05-28T06:19:40.292710+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949180292_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"22","depth":4,"bounds":{"left":0.68650264,"top":0.123703115,"width":0.009973404,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","depth":3,"bounds":{"left":0.41156915,"top":0.6217079,"width":0.3257979,"height":0.027134877},"on_screen":true,"value":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","role_description":"text field","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}]...
|
-5836513839804454374
|
6685203931840321117
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79145
|
2782
|
20
|
2026-05-28T06:19:41.336507+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949181336_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"21","depth":4,"bounds":{"left":0.6868351,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","depth":3,"bounds":{"left":0.41156915,"top":0.6217079,"width":0.3257979,"height":0.027134877},"on_screen":true,"value":"[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1","role_description":"text field","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}]...
|
-7143860154392464725
|
6685203931303450205
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
[42000][1064] (conn=3864) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and type = 'multi-picklist'' at line 1
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79144
|
NULL
|
NULL
|
NULL
|
|
79146
|
2781
|
18
|
2026-05-28T06:19:42.081508+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949182081_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":false,"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":true,"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":"21","depth":4,"on_screen":true,"role_description":"text"}]...
|
-6687212138240739342
|
5771048317937760189
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21...
|
79143
|
NULL
|
NULL
|
NULL
|
|
79147
|
2782
|
21
|
2026-05-28T06:19:42.394178+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949182394_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormViewCodRurToolsWindowFV faVsco.s ~%0tv-mno PhpStormViewCodRurToolsWindowFV faVsco.s ~%0tv-mnotC.themieein.hasdor.torterolasKerodloh© SyncMailbox.phpTMockariitEinfection ison distTextRelayServiceTest.phpphp fiminny.phpAloco Rald ovtonde MadolMANiStNAwERtosanemaiimiony storaceuse RequiresUUID.use Enums:MMakerd# package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phounit.xmlTraw_sal.guery.soM4 README.mdlfê sonar-proiect-propertiosEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWICONDAY CITZONG IMORNZUTAYpublic const int NAME_ MAXLENGTH = 128:public const int LABEL_MAX_LENGTH = 255usaoesoublic const sint DESCRIPTION MAXLENGTH = 191public const string TYPE_MULTIPICKLISI = 'nulti-picklist':I/ Not vet supportedoubliie const stoing TYPE PERCENToercent> h Extemal Librariesv Eg Scratches and Consolesv E Database Consolesconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowsoes roeAN fiiminovAlocalbostsswealitiiminowoestaeASE fliminnvAlocnlboenR588883822832oub dic const strind tpe prikastiockustpublic constnuhilse conetetasnd Tpr eeENhpublic conststring TYPE_BOOLEAXnuhllsie conetetaneivprtiseipublic const string VYPE_VEXTAREApublic conststring TYPE_EMALLpublic conststring TYPE_PHONEpublic constSTTiNG TYPE TRIpublic const string TYPE_DATEpublic const string TYPE_TIMEpublic const string TYPE DATETIMEpublic conststring TYPE UNSUPPORTED = "unsupported"& zoho_dev fiminny@localhost• Аpроnpublic const string OBJECT_LEADoublic const stoing ORJECT ACCOUNT"account"#concalo ropontServico,+o₫7) Outputtii liminny.crm fields Xv MDatabas,V AEUA consoleofo4Дid Yuuid YTeAudweooo4а@аAф#R.cra.configunatston savimenn nrovsden "ayyliminny@loch nostA HSJJocalcancaloN CTAGINGrancaloTnastorEA TAOY KINT MINNH AG CROCS GYCGOT COO GOOTD HAVING NNGO INTEPCEOT INTO IOINTTOOУ L7Thu 28 May 9:19:42TextRelayServiceTestconedls errmA console (EU)console (STAGING]AAXAAYDB000ner hensewiet+0.Do jminnycan I test it locally first. if I place env from stagingUaalalyzyoselect * fron con confiqunatzions where orowiden = "ofnednive*:SELECTYes, The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.json (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from staginghownenid ERoM sochall accountesalJOIN users u on u.id = sa.sociable_idancos"ontside u.tean.THEPE uatean $id = 19 and sarorovider = "oinedoive".GOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPICDEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.com# the Pub/Sub topic namaeu or usSELECT + FROM social accountsWHEDE 3d = 111693. Run the svnc manualiv vin tinker tinside docker 1ae 10lE262UPDATE social accounts SET provider user token = *vlu:AQIBAH)-LzTNK2yuuuaLqifzhWb9crUNKTpk4FL09rjnXqp 6AЕQhDhDQVa1nviCHEvnp'b bashaegdocker exec -it docker_lamp_1 php artisan tinkeCtato IAnnoAtodNUEOE 2AC 11160app(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():"provider user token": "viu:AQIBAH"-LzTNK2yuuuaLq{fzh#b9crUNKTpk4F109rjnXop_6AE0hDhDQVa1nviCHEvnpvSEAAAAf$B8Bqkqhkd69BBВи:"provider refresh token": "5034113:[TELEGRAM_TOKEN]b2bfc"вvakanol: 4220001009Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnselect * fron crn field valuestioh.select * fron crn_fsplds where type = 'nulti-picklist';Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sowService=ssvc-soetServicelconttatainny.google text user"Ask anuthino (2a1§ AdaptiveCSVy1zLS.00mlabel yn decenintion ?m.twoeslength Y1m default value Y:mobrect type Y : Imis selectable y : imis mandatonymis filterable Y27221 lITS8 ensd...
|
NULL
|
-2083693529530178043
|
NULL
|
typing_pause
|
ocr
|
NULL
|
PhpStormViewCodRurToolsWindowFV faVsco.s ~%0tv-mno PhpStormViewCodRurToolsWindowFV faVsco.s ~%0tv-mnotC.themieein.hasdor.torterolasKerodloh© SyncMailbox.phpTMockariitEinfection ison distTextRelayServiceTest.phpphp fiminny.phpAloco Rald ovtonde MadolMANiStNAwERtosanemaiimiony storaceuse RequiresUUID.use Enums:MMakerd# package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phounit.xmlTraw_sal.guery.soM4 README.mdlfê sonar-proiect-propertiosEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWICONDAY CITZONG IMORNZUTAYpublic const int NAME_ MAXLENGTH = 128:public const int LABEL_MAX_LENGTH = 255usaoesoublic const sint DESCRIPTION MAXLENGTH = 191public const string TYPE_MULTIPICKLISI = 'nulti-picklist':I/ Not vet supportedoubliie const stoing TYPE PERCENToercent> h Extemal Librariesv Eg Scratches and Consolesv E Database Consolesconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowsoes roeAN fiiminovAlocalbostsswealitiiminowoestaeASE fliminnvAlocnlboenR588883822832oub dic const strind tpe prikastiockustpublic constnuhilse conetetasnd Tpr eeENhpublic conststring TYPE_BOOLEAXnuhllsie conetetaneivprtiseipublic const string VYPE_VEXTAREApublic conststring TYPE_EMALLpublic conststring TYPE_PHONEpublic constSTTiNG TYPE TRIpublic const string TYPE_DATEpublic const string TYPE_TIMEpublic const string TYPE DATETIMEpublic conststring TYPE UNSUPPORTED = "unsupported"& zoho_dev fiminny@localhost• Аpроnpublic const string OBJECT_LEADoublic const stoing ORJECT ACCOUNT"account"#concalo ropontServico,+o₫7) Outputtii liminny.crm fields Xv MDatabas,V AEUA consoleofo4Дid Yuuid YTeAudweooo4а@аAф#R.cra.configunatston savimenn nrovsden "ayyliminny@loch nostA HSJJocalcancaloN CTAGINGrancaloTnastorEA TAOY KINT MINNH AG CROCS GYCGOT COO GOOTD HAVING NNGO INTEPCEOT INTO IOINTTOOУ L7Thu 28 May 9:19:42TextRelayServiceTestconedls errmA console (EU)console (STAGING]AAXAAYDB000ner hensewiet+0.Do jminnycan I test it locally first. if I place env from stagingUaalalyzyoselect * fron con confiqunatzions where orowiden = "ofnednive*:SELECTYes, The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.json (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from staginghownenid ERoM sochall accountesalJOIN users u on u.id = sa.sociable_idancos"ontside u.tean.THEPE uatean $id = 19 and sarorovider = "oinedoive".GOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPICDEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.com# the Pub/Sub topic namaeu or usSELECT + FROM social accountsWHEDE 3d = 111693. Run the svnc manualiv vin tinker tinside docker 1ae 10lE262UPDATE social accounts SET provider user token = *vlu:AQIBAH)-LzTNK2yuuuaLqifzhWb9crUNKTpk4FL09rjnXqp 6AЕQhDhDQVa1nviCHEvnp'b bashaegdocker exec -it docker_lamp_1 php artisan tinkeCtato IAnnoAtodNUEOE 2AC 11160app(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():"provider user token": "viu:AQIBAH"-LzTNK2yuuuaLq{fzh#b9crUNKTpk4F109rjnXop_6AE0hDhDQVa1nviCHEvnpvSEAAAAf$B8Bqkqhkd69BBВи:"provider refresh token": "5034113:[TELEGRAM_TOKEN]b2bfc"вvakanol: 4220001009Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnselect * fron crn field valuestioh.select * fron crn_fsplds where type = 'nulti-picklist';Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sowService=ssvc-soetServicelconttatainny.google text user"Ask anuthino (2a1§ AdaptiveCSVy1zLS.00mlabel yn decenintion ?m.twoeslength Y1m default value Y:mobrect type Y : Imis selectable y : imis mandatonymis filterable Y27221 lITS8 ensd...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79148
|
2782
|
22
|
2026-05-28T06:19:45.001360+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949185001_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"21","depth":4,"bounds":{"left":0.6868351,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
6645075803780273613
|
6685203931303450205
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79147
|
NULL
|
NULL
|
NULL
|
|
79149
|
2782
|
23
|
2026-05-28T06:20:02.236695+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949202236_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute
Explain Plan...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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}]...
|
-8048766869408449997
|
5771048316864018365
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute
Explain Plan...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79150
|
2781
|
19
|
2026-05-28T06:20:02.133636+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949202133_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp100% C47 8• Thu 28 May 9:20:01DOCKER (docker-compose)screenpipe"181DOCKER₴81DEV (docker)₴2-zsh883T1DOCKER (docker-compose)docker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=15 >'/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:18:18 Running ['artisan'conference:monitor:count] ….. 1s DONEdocker_lamp_1 | , '/usr/local/bin/php' 'artisan' conference:monitor:count › */proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:18:19 Running ['artisan'mailbox:batch:retry-failedatches=15]in backgrounddocker_lamp_1• ('/usr/local/bin/php' 'artisan'mailbox:batch:retry-failed--max-batcheS=15 >'/proc/1/fd/1' 2>&1 ; '/usr/local/bin/php' 'artisan'schedule: finish"framework/schedule-390defd641effba0f73a895e426ded4cf2ba7f11" "$?") ›'/dev/null' 2>&1 &docker_lamp_12026-05-28 06:18:19 Running ['artisan' crm:autolog-delayed]tologdelayedjobs for all applicable teams:docker_1amp_12s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'crm: autolog-delayed › '/proc/1/fd/1' 2>&1docker_lamp_1docker_lamp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1docker_lamp_12026-05-28 06:19:01 Running ['artisan'meeting-bot:schedule-bot] ... 1s DONEdocker_lamp_11, '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot › */proc/1/fd/12>&1docker_1amp_12026-05-28 06:19:03 Running ['artisan' dialers:monitor-activities] . 1s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:19:04 Running ['artisan' jiminny:monitor-social-accounts]1s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:19:05 Running ['artisan'mailbox:skip-lists:refresh]. 1s DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh > '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:19:06 Running ['artisan'mailbox:batch:process --max-batches=15]2S DONEdocker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process--max-batches=15>'/proc/1/fd/1'docker_lamp_1docker_lamp_1I run_artisan_schedule: Done waiting for schedule:run84-zsh85...ip-10-30-129-190:~ (nc)T2PROD (ssh)S[URL_WITH_CREDENTIALS] T3 EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |T5QA (-zsh)XT6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lPRODSTAGEFRONTENDEXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [EXTENSIONView in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach...
|
NULL
|
1770270135524145090
|
NULL
|
click
|
ocr
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp100% C47 8• Thu 28 May 9:20:01DOCKER (docker-compose)screenpipe"181DOCKER₴81DEV (docker)₴2-zsh883T1DOCKER (docker-compose)docker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=15 >'/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:18:18 Running ['artisan'conference:monitor:count] ….. 1s DONEdocker_lamp_1 | , '/usr/local/bin/php' 'artisan' conference:monitor:count › */proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:18:19 Running ['artisan'mailbox:batch:retry-failedatches=15]in backgrounddocker_lamp_1• ('/usr/local/bin/php' 'artisan'mailbox:batch:retry-failed--max-batcheS=15 >'/proc/1/fd/1' 2>&1 ; '/usr/local/bin/php' 'artisan'schedule: finish"framework/schedule-390defd641effba0f73a895e426ded4cf2ba7f11" "$?") ›'/dev/null' 2>&1 &docker_lamp_12026-05-28 06:18:19 Running ['artisan' crm:autolog-delayed]tologdelayedjobs for all applicable teams:docker_1amp_12s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'crm: autolog-delayed › '/proc/1/fd/1' 2>&1docker_lamp_1docker_lamp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1docker_lamp_12026-05-28 06:19:01 Running ['artisan'meeting-bot:schedule-bot] ... 1s DONEdocker_lamp_11, '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot › */proc/1/fd/12>&1docker_1amp_12026-05-28 06:19:03 Running ['artisan' dialers:monitor-activities] . 1s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:19:04 Running ['artisan' jiminny:monitor-social-accounts]1s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:19:05 Running ['artisan'mailbox:skip-lists:refresh]. 1s DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh > '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:19:06 Running ['artisan'mailbox:batch:process --max-batches=15]2S DONEdocker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process--max-batches=15>'/proc/1/fd/1'docker_lamp_1docker_lamp_1I run_artisan_schedule: Done waiting for schedule:run84-zsh85...ip-10-30-129-190:~ (nc)T2PROD (ssh)S[URL_WITH_CREDENTIALS] T3 EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |T5QA (-zsh)XT6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lPRODSTAGEFRONTENDEXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [EXTENSIONView in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79151
|
2782
|
24
|
2026-05-28T06:20:07.656766+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949207656_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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}]...
|
6458054629937925028
|
5771048316864018365
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny...
|
79149
|
NULL
|
NULL
|
NULL
|
|
79152
|
2781
|
20
|
2026-05-28T06:20:07.757341+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949207757_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"21","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
6645075803780273613
|
6685203931303450205
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79150
|
NULL
|
NULL
|
NULL
|
|
79287
|
NULL
|
0
|
2026-05-28T06:23:28.915626+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949408915_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormCootRurToolsWindowFV faVsco.|s ~%oIv-motc. PhpStormCootRurToolsWindowFV faVsco.|s ~%oIv-motc.thamineKerodloh© SyncMailbox.phpEinfection ison distTextRelayServiceTest.phpphp fiminny.phpclass Field extends ModelMANISRNAWERHOsanemaiimiony storaceuse RequiresUUIdnee EnuasMMakerd# package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phounit.xmlTraw_sal.guery.soMAPCAOMS mafê sonar-proiect-propertiosEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWCONDAN CIYRONG IMORNIZNRAYpublic const int NAME MAX_LENGTH = 128oublic const int LABEL MAXLENGTH = 255:oublic const sint DESCRIPTION MAXLENGTH = 191;oublic const stoing TYPE MULTTPICKLTST = 'multi-picklist':I Not vet supportedoub1ie const string TYPE PERCENTIqub sic const string tpE PriKeisT> h Extemal Librariesv Eg Scratches and Consolesv E Database Consolesconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowsoes roeAN fiiminovAlocalbostwsweslitiiminowoesnnehASE fliminnvAlocslboett0682290809nuhite conet sranewpr wieeshnuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhlle conet etanaivoshnhile conet etaiinauivor10public const string TYPE DATEpublic const string TYPE TIMEpublic const string TYPE DATETIME& zoho_dev jiminny@localhost)• Аpроnpublic const string OBJECT_LEADoublic const stoing OBJECT ACCOUNT"account"#concalo ropontServico,+o₫7) Outputtit jiminny.crm-fieldsv MDatabas,V AEUA console84 roursR1d YWuTO with teaclon2196 cec58cb7-6898-4b7f-abac-f7cc61c3c077#S:641.mA HSLlocal2280 [CREDIT_CARD]-bb6c-113d76272cSd2280076c3h49-49a1-418d-83c5-p9/965765700cancalo2286 Ad050/59-0735-1+06-h494.2171132666c6V CTAGNG2287 1694f808-8795-4632-98b1-292ffcf8c3b:rancalo2295 37acf12d-38c7-4df9-853c-15S462945e16Tnastor2360 68ca7aS2-2c82-428d-ba56-67bb384dd6072376 c7854086-1cd2-4Ra8-ReRc-A56c616104£e2HIS RAONCAR-7703-1A9A-AA89-92C80997C/1.2446 4а970572-7002-4731-81a6-f351698ad1e2Oh touc totrouod etortina tram lin 677 me lordh tn Chi ma tonhinh: 632 meTMockariitlaravel.logS-tim anuchioesthoehXconedia PereA console (STAGING)E| AALAAY D6000seitct * fron cra.configurations where providen = 'esestcáve" :249E2se—251252=255CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)* ELSE ** END) AS user_iduhensasa.*,t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idMoniM teans+1..n<->1: on t.id = u.tean_igWHERE U.tean_id = 19 and sa-provider = 'pipednive":A console (EU)Do jminny259266=268269272I I1UaalalyzyoSELECT * FROM social accounts WHERE id = 1116:UPDATE social accounts SET provider user token = *vlu:AQIBAH)-LzTNK2yuuuaLqifzhWb9crUNKTpk4FL09rjnXqp 6AЕQhDhDQVa1nviCHEvnp'provider refresh token = 5034113:[TELEGRAM_TOKEN]b2bfc'expires = 1779891997,state = 'connectedWHERE 10 = 1116:"provider user token": "viu:AQIBAH"-LzTNK2yuuuaLq{fzh#b9crUNKTpk4F109rjnXop_6AE0hDhDQVa1nviCHEvnpvSEAAAAf$B8Bqkqhkd69BBВи:"provider refresh token": "5034113:[TELEGRAM_TOKEN]b2bfc""expires": 1779891997select * fron crn field valuesselect * fron crn_fields where type = 'nulti-picklist':lдаHEA®R con configuration id 7Limene nnousden 1dJT FRUSUELLLINEOCHUCIILC39 ininny coled39 Teans30 Ruving Reasonsd39 Billing Currencyc39 Jiininny Intetgrations39 Conpetitors Involved39 Web Conference30 Osalen2 hs_all_collaborator_ouner_ids2 hs all deal split_ouner_ideLabel "Jininny noldTeantBuwina ReasonsBilLing CurrencyJininny IntegrationsComoetitors Involverweb conterencemhiallennasl CollabonstorDeal Split Usendadescrsption Y<null)<nutl<null>• m) type M(D lengthUa ocroueewaimeconllsBanl1<null>nulti-nicktienulti-picklistnulti-nicklistOwner ids of the users involved in.nulti-picklistThe owner ids of all associated De.nulti-picklist4899 <null)4899 <nult4909 coull4899 US Dollars4899 <null4999 cnull4899 <null)4900 coul1)‹null> ‹null»snull> snullTO0%L7Thu 28 May 9:23:28TextRelayServiceTestrner hensewiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail nailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10lb bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnantorectly via tinker to verity the header loaic without disoatchino amvthinotioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthino (2a1§ AdaptiveCSVyДus.00Umlobsect tunein is selectableam is nandatory Min is filterable yconaeonnoruntonnortunstopportunityopportunityopnoruntRlea.opportunityopportunityNU MMad TosmODICA LITE OTensAo....
|
NULL
|
1554983338726956151
|
NULL
|
visual_change
|
ocr
|
NULL
|
PhpStormCootRurToolsWindowFV faVsco.|s ~%oIv-motc. PhpStormCootRurToolsWindowFV faVsco.|s ~%oIv-motc.thamineKerodloh© SyncMailbox.phpEinfection ison distTextRelayServiceTest.phpphp fiminny.phpclass Field extends ModelMANISRNAWERHOsanemaiimiony storaceuse RequiresUUIdnee EnuasMMakerd# package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phounit.xmlTraw_sal.guery.soMAPCAOMS mafê sonar-proiect-propertiosEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWCONDAN CIYRONG IMORNIZNRAYpublic const int NAME MAX_LENGTH = 128oublic const int LABEL MAXLENGTH = 255:oublic const sint DESCRIPTION MAXLENGTH = 191;oublic const stoing TYPE MULTTPICKLTST = 'multi-picklist':I Not vet supportedoub1ie const string TYPE PERCENTIqub sic const string tpE PriKeisT> h Extemal Librariesv Eg Scratches and Consolesv E Database Consolesconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowsoes roeAN fiiminovAlocalbostwsweslitiiminowoesnnehASE fliminnvAlocslboett0682290809nuhite conet sranewpr wieeshnuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhlle conet etanaivoshnhile conet etaiinauivor10public const string TYPE DATEpublic const string TYPE TIMEpublic const string TYPE DATETIME& zoho_dev jiminny@localhost)• Аpроnpublic const string OBJECT_LEADoublic const stoing OBJECT ACCOUNT"account"#concalo ropontServico,+o₫7) Outputtit jiminny.crm-fieldsv MDatabas,V AEUA console84 roursR1d YWuTO with teaclon2196 cec58cb7-6898-4b7f-abac-f7cc61c3c077#S:641.mA HSLlocal2280 [CREDIT_CARD]-bb6c-113d76272cSd2280076c3h49-49a1-418d-83c5-p9/965765700cancalo2286 Ad050/59-0735-1+06-h494.2171132666c6V CTAGNG2287 1694f808-8795-4632-98b1-292ffcf8c3b:rancalo2295 37acf12d-38c7-4df9-853c-15S462945e16Tnastor2360 68ca7aS2-2c82-428d-ba56-67bb384dd6072376 c7854086-1cd2-4Ra8-ReRc-A56c616104£e2HIS RAONCAR-7703-1A9A-AA89-92C80997C/1.2446 4а970572-7002-4731-81a6-f351698ad1e2Oh touc totrouod etortina tram lin 677 me lordh tn Chi ma tonhinh: 632 meTMockariitlaravel.logS-tim anuchioesthoehXconedia PereA console (STAGING)E| AALAAY D6000seitct * fron cra.configurations where providen = 'esestcáve" :249E2se—251252=255CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)* ELSE ** END) AS user_iduhensasa.*,t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idMoniM teans+1..n<->1: on t.id = u.tean_igWHERE U.tean_id = 19 and sa-provider = 'pipednive":A console (EU)Do jminny259266=268269272I I1UaalalyzyoSELECT * FROM social accounts WHERE id = 1116:UPDATE social accounts SET provider user token = *vlu:AQIBAH)-LzTNK2yuuuaLqifzhWb9crUNKTpk4FL09rjnXqp 6AЕQhDhDQVa1nviCHEvnp'provider refresh token = 5034113:[TELEGRAM_TOKEN]b2bfc'expires = 1779891997,state = 'connectedWHERE 10 = 1116:"provider user token": "viu:AQIBAH"-LzTNK2yuuuaLq{fzh#b9crUNKTpk4F109rjnXop_6AE0hDhDQVa1nviCHEvnpvSEAAAAf$B8Bqkqhkd69BBВи:"provider refresh token": "5034113:[TELEGRAM_TOKEN]b2bfc""expires": 1779891997select * fron crn field valuesselect * fron crn_fields where type = 'nulti-picklist':lдаHEA®R con configuration id 7Limene nnousden 1dJT FRUSUELLLINEOCHUCIILC39 ininny coled39 Teans30 Ruving Reasonsd39 Billing Currencyc39 Jiininny Intetgrations39 Conpetitors Involved39 Web Conference30 Osalen2 hs_all_collaborator_ouner_ids2 hs all deal split_ouner_ideLabel "Jininny noldTeantBuwina ReasonsBilLing CurrencyJininny IntegrationsComoetitors Involverweb conterencemhiallennasl CollabonstorDeal Split Usendadescrsption Y<null)<nutl<null>• m) type M(D lengthUa ocroueewaimeconllsBanl1<null>nulti-nicktienulti-picklistnulti-nicklistOwner ids of the users involved in.nulti-picklistThe owner ids of all associated De.nulti-picklist4899 <null)4899 <nult4909 coull4899 US Dollars4899 <null4999 cnull4899 <null)4900 coul1)‹null> ‹null»snull> snullTO0%L7Thu 28 May 9:23:28TextRelayServiceTestrner hensewiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail nailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10lb bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnantorectly via tinker to verity the header loaic without disoatchino amvthinotioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthino (2a1§ AdaptiveCSVyДus.00Umlobsect tunein is selectableam is nandatory Min is filterable yconaeonnoruntonnortunstopportunityopportunityopnoruntRlea.opportunityopportunityNU MMad TosmODICA LITE OTensAo....
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79288
|
2785
|
0
|
2026-05-28T06:23:32.022513+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949412022_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
7650400725798722197
|
5771048316864018365
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}...
|
79287
|
NULL
|
NULL
|
NULL
|
|
79289
|
2785
|
1
|
2026-05-28T06:23:35.114794+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949415114_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"21","depth":4,"bounds":{"left":0.6868351,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"}]...
|
1909055016855846995
|
5771048317937760189
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79292
|
2785
|
4
|
2026-05-28T06:23:45.776383+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949425776_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM activities WHERE uuid_to_bin('Billing_Currency__c') = uuid;
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"21","depth":4,"bounds":{"left":0.6868351,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM activities WHERE uuid_to_bin('Billing_Currency__c') = uuid;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM activities WHERE uuid_to_bin('Billing_Currency__c') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
-2974990936021296613
|
6685203931303450205
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM activities WHERE uuid_to_bin('Billing_Currency__c') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79291
|
NULL
|
NULL
|
NULL
|
|
79293
|
2785
|
5
|
2026-05-28T06:23:47.883560+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949427883_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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}]...
|
2010010528312112239
|
447361605302422466
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
PhpStormCootRurToolsWindowFV faVsco.|s ~%oIv-motc.thamineKerodloh© SyncMailbox.phpEinfection ison distTextRelayServiceTest.phpphp fiminny.phpclass Field extends ModelMANiStNAwERtosanemaiimiony storaceuse RequiresUUIduse EnunsMMakerd# package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phounit.xmlTraw_sal.guery.soMAPCAOMS mapublic const int NAME MAX_LENGTH = 128oublic const int LABEL MAXLENGTH = 255:oublic const sint DESCRIPTION MAX_LENGTH = 191;ô sonar-proiect propertiesEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWICONDAY CITZONG IMORNZUTAYpublic const string TYPE_MULTIPICKLIST = 'nulti-picklist';Not vet supportedoub1ie const string TYPE PERCENTIqubsic const string ipE PriKEST> h Extemal Librariesv Eg Scratches and Consolesv E Database Consolesconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowtoes oeAN fiiminovAlocalbostwsweslitiiminowoesnnehASE fliminnvAlocslboett0682290809nuhite conet sranewpr wieeshnuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivoshnhile conet etatno. vos felpublic const string TYPE DATEpublic const string TYPE TIMEpublic const string TYPE DATETIMEpublic const string TYPE UNSUPPORTED = *unsupported'=& zoho_dev fiminny@localhost• Аpроnpublic const string OBJECT_LEAGoublic const stoing OBJECT ACCOUNT"account"#concalo ropontServico,+o₫7) Outputtit jiminny.crm-fieldsv MDatabas,V AEUA console84 rours3id Vim uuid UUID with time-low a.2194 12bafdc8-ca2b-43f6-abc6-ed3894d3b1852196 cec58eb7-6890-4b7f-abae-f7cef1c3c073#S:641.mA HSLlocalvonel2280 30460140-9e44-4531-bb6c-113076277c5d2282e76c3h40-69a1-418d-83c5-8Q4945755700cancaloMihinnso sa-cksehhontireyhthkylreeV CTAGNG2287 1094f808-8795-4632-98b1-292ffcf0c3bfrancalo2295 37аcf12d-38c7-4df9-853c-155462845e10Tnastor2360 68ca7a52-2082-428d-ba56-6766384d06072374 с7856986-1602-4830-808c-C560616494402445 [CREDIT_CARD]-3688-02-898836412w40024690-2900-1971.9106.67614060d109Oh touc totrouod etortina tram lin 677 me lordh tn Chi ma tonhinh: 632 meMockeriitcustom.loglaravel.logSF (iminny@localhost) xHS Jocal jiminny@blocalhostconsole [PROD)# consolefFulA console (STAGINGTwWLAV257=260E 261=268269TeAuto tDo jminny021 A1 A18 V2 V6 Aselect * fron crn_configurations nhere provider = 'pipedeive':CONCAT(u.id, CASE WHEN u.id = t.ouner_id THEN • (ouner)* ELSE "* END) AS user_id,sa.*t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJOIN teans t 1.n<->1: on t.id = u.team_idAHERE u.tean_id = 19 and sa.provider = 'pipedcive':SELECT * FROM social accounts WHERE id = 1116;JPDATE social accounts SET provider user token = *viu:AQIBAH)-LzTNK2yuuuaLqifzhWb9crUNKTpk«F109rjnXqp_6AЕQhDhDQVa1nvICHEvnpvprovider refresh token = '5034113:[TELEGRAM_TOKEN]b2bfc*,BApANES- 2//Y0Y2777State a "connecten»MUFRESOE 1110provider user token": "viu:AQIBAH"-L2TNK2yuuuaLqifzh#b9crUNKTpk4F109rsnXqp_6AE0hDhDQVa1nvWCHEvnpvSEAAAAf$B8Bqkqhkd69w0BBwa"provider refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfcexotres. 1/19091497selec * tron cra tzelo valuesseleci * tron cra tzclos where type = "aulz-oickois*SELECT * FROM actávitios WHERE uuid to bin('Billing Currencyc') = uuid:даHEA®R con configuration id Vam coe provider id v39 Prospecting Sequencec39 Jininny role.d39 Teans30 Ruvine Reasonse70 84115n0 Curcency C39 Jiiminny_Intetgrations..d39 Conpetiitors_Involved.g39 Web Conferencec39 Dialerm) Label MProspecting SequenceJininny rolcTeansRUMSnO RAASOnIhusnerrunnenerJiminny IntegrationsComoetitors InvolvedTAh GAnferenchDialer2hs_all_collaborator_ouner_ids"he old donl colit ounorn iddaencozmboratonnas Coii+ lieoncim) description(m length vshuttcnull>cou1s<null>cnull><null>Am) type "nulti-picklistnulti-picklistnultcoickustaut-nickistanltfenichlieOuner ide of the usens involwedisindnuldonicklisim default value "4899 <null4099 <null>4899 cnull)4900 coul1)4899 US Dollars1400 conll4999 cnul4899 cnulls4899 <nul1)TOOУ L7Thu 28 May 9:23:47TextRelayServiceTestaer henseict+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas wou'd need in olacel1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the sunc manualiv vin tinker tinside docker 1aeo 1%eossttaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnentorectly via tinker to verity the header loaic without disoatchino amvthinotioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthino (2a1§ AdaptiveCSVyДus.00am obrect typein is selectableam is nandatory Min is filterablecontaccontactonnoruntonnontuinannanttunsopportunityOetonononnortunMnleur Tosm272-7ensa....
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79297
|
2784
|
0
|
2026-05-28T06:24:28.274839+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949468274_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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}]...
|
-147301692555525249
|
-8776298399911410750
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴81DEV (docker)₴2-zsh88311DOCKER (docker-compose)docker_lamp_1docker_lamp_1run_artisan_schedule: Done waiting forschedule: rundocker_lamp_12026-05-28 06:23:40 Jiminny|Services\Crm\IntegrationApp\Jobs\ValidateTeamActiveConnectionJobRUNNINGdocker_lamp_1| [IP_ADDRESS]/May/2026:06:23:38 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_12026-05-28 06:23:41 Jiminny\Services\Crm\IntegrationApp\Jobs\ValidateTeamActiveConnectionJob255.91ms DONEdocker_lamp_11 [IP_ADDRESS] -28/May/2026:06:23:46 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 5[PHONE]6 wwwelasticsearch1 {"type": "server""timestamp":"2026-05-28T06:23:58,778Z","level": "INFO""component": "o.e.m.j.JvmGcMonitorService""cluster.name": "docker-cluster""node. name":"36d5cc114f53", "message":"[gc] [26269] overhead,spent [434ms] collecting in the last [1s]"cluster.uuid": "8uhZw1CUSGyWYR_OvaKx6g","node.id":"e2ZKzgw4Q4aCf2w51jWr1A"docker_lamp_11 [IP_ADDRESS] -28/May/2026:06:23:57+0000 "GET /index.php" 500 /home/jiminny/public/index.php 5[PHONE]6 wwwdocker_1amp_1docker_lamp_1 |2026-05-28 06:24:04 Running ['artisan' meeting-bot:schedule-bot] ….. 2s DONEdocker_lamp_1• 2>81" '/usr/local/bin/php' 'artisan'meeting-bot: schedule-bot > /proc/1/fd/1docker_lamp_1ONEdocker_1amp_12026-05-28 06:24:07 Running ['artisan'dialers:monitor-activities] . 4s D, '/usr/local/bin/php' 'artisan' dialers:monitor-activities > '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:24:11 Running ['artisan'jiminny:monitor-social-accounts] [IP_ADDRESS] -28/May/2026:06:24:08 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4[PHONE]6wwWdocker_lamp_14S DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:24:16 Running ['artisan'mailbox:skip-lists:refresh] [IP_ADDRESS]/May/2026:06:24:18 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4906.31514336 wwwdocker_lamp_1docker_lamp_11 . 7s DONE1 '/usr/local/bin/php' 'artisan'mailbox:skip-lists:refresh > */proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:24:24 Running ['artisan' mailbox:batch:process --max-batcheS=15]2s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 ›'/proc/1/fd/1' 2>&1View in Docker Desktop@ View ConfigL View Logsw Enable Watchd DetachDOCKER (docker-compose)screenpipe"84T2-zsh85...ip-10-30-129-190:~ (nc)PROD (ssh)S[URL_WITH_CREDENTIALS] 13EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.STAGE*** System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |T5QA (-zsh)~$0t6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [EXTENSION...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79298
|
2784
|
1
|
2026-05-28T06:24:36.639942+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949476639_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"21","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
7276018078360034670
|
6685203931303450205
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;...
|
79297
|
NULL
|
NULL
|
NULL
|
|
79299
|
2784
|
2
|
2026-05-28T06:24:37.820808+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949477820_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp-zshDOCKER₴81DEV (docker)₴2883T1DOCKER (docker-compose)docker_lamp_1docker_lamp_12026-05-28 06:24:04 Running ['artisan'meeting-bot:schedule-bot]... 2s DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot > */proc/1/fd/1' 2>&1docker_lamp_1ONEdocker_lamp_12026-05-28 06:24:07 Running ['artisan'dialers:monitor-activities] . 4s Dl '/usr/local/bin/php' 'artisan' dialers:monitor-activities › '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:24:11 Running ['artisan'jiminny:monitor-social-accounts][IP_ADDRESS]/May/2026:06:24:08 +0000 "GET /index.php" 500 /home/jiminny/public/index.php4[PHONE]6 wwwdocker_lamp_14s DONEdocker_lamp_1, '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:24:16 Running ['artisan'mailbox:skip-lists:refresh] [IP_ADDRESS]/May/2026:06:24:1815+0000 "GET /index.php" 500 /home/jiminny/public/index.php 4906.314336 wwwdocker_lamp_1docker_lamp_1/1'1 . 7s DONE1 '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › */proc/1/fd2>&1docker_lamp_12026-05-28 06:24:24 Running ['artisan'mailbox:batch:process --max-batches=15J2s DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 >'/proc/1/fd/1'docker_lamp_12026-05-28 06:24:26 Running ['artisan'conference:monitor:count]... 4s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan'conference:monitor:count > */proc/1/fd/12>&1docker_lamp_12026-05-28 06:24:30 Running ['artisan'activity:aircall:check-and-renew][IP_ADDRESS]/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6 wwwdocker_lamp_1docker_lamp_1• '/usr/local/bin/php' 'artisan' activity:aircall:check-and-renew > '/prodocker_lamp_12026-05-28 06:24:33 Running ['artisan' track:retry-failed-downloads]docker_lamp_1fd/1' 2>&1docker_lamp_1docker_lamp_1l '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › */proc/1/run_artisan_schedule: Done waiting for schedule:runDOCKER (docker-compose)screenpipe"O ₴4T2-zshSee85...ip-10-30-129-190:~ (nc)PROD (ssh)[URL_WITH_CREDENTIALS] (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |T5QA (-zsh)STAGET6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [EXTENSIONView in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach...
|
NULL
|
-4016397692851107789
|
NULL
|
click
|
ocr
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp-zshDOCKER₴81DEV (docker)₴2883T1DOCKER (docker-compose)docker_lamp_1docker_lamp_12026-05-28 06:24:04 Running ['artisan'meeting-bot:schedule-bot]... 2s DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot > */proc/1/fd/1' 2>&1docker_lamp_1ONEdocker_lamp_12026-05-28 06:24:07 Running ['artisan'dialers:monitor-activities] . 4s Dl '/usr/local/bin/php' 'artisan' dialers:monitor-activities › '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:24:11 Running ['artisan'jiminny:monitor-social-accounts][IP_ADDRESS]/May/2026:06:24:08 +0000 "GET /index.php" 500 /home/jiminny/public/index.php4[PHONE]6 wwwdocker_lamp_14s DONEdocker_lamp_1, '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:24:16 Running ['artisan'mailbox:skip-lists:refresh] [IP_ADDRESS]/May/2026:06:24:1815+0000 "GET /index.php" 500 /home/jiminny/public/index.php 4906.314336 wwwdocker_lamp_1docker_lamp_1/1'1 . 7s DONE1 '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › */proc/1/fd2>&1docker_lamp_12026-05-28 06:24:24 Running ['artisan'mailbox:batch:process --max-batches=15J2s DONEdocker_1amp_1• '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 >'/proc/1/fd/1'docker_lamp_12026-05-28 06:24:26 Running ['artisan'conference:monitor:count]... 4s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan'conference:monitor:count > */proc/1/fd/12>&1docker_lamp_12026-05-28 06:24:30 Running ['artisan'activity:aircall:check-and-renew][IP_ADDRESS]/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6 wwwdocker_lamp_1docker_lamp_1• '/usr/local/bin/php' 'artisan' activity:aircall:check-and-renew > '/prodocker_lamp_12026-05-28 06:24:33 Running ['artisan' track:retry-failed-downloads]docker_lamp_1fd/1' 2>&1docker_lamp_1docker_lamp_1l '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › */proc/1/run_artisan_schedule: Done waiting for schedule:runDOCKER (docker-compose)screenpipe"O ₴4T2-zshSee85...ip-10-30-129-190:~ (nc)PROD (ssh)[URL_WITH_CREDENTIALS] (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |T5QA (-zsh)STAGET6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [EXTENSIONView in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79300
|
2784
|
3
|
2026-05-28T06:24:39.754933+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949479754_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
Project
Project
New File or Directory…
Expand Selected...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"21","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;","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}]...
|
-3240810663929179671
|
6685203931303450205
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
Project
Project
New File or Directory…
Expand Selected...
|
79299
|
NULL
|
NULL
|
NULL
|
|
79301
|
2784
|
4
|
2026-05-28T06:24:42.063491+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949482063_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴8111DOCKER (docker-compose)DEV (docker)₴2-zsh883docker_lamp_12>&1docker_1amp_1ONE• '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot > */proc/1/fd/12026-05-28 06:24:07 Running ['artisan' dialers:monitor-activities] . 4s Dl '/usr/local/bin/php' 'artisan' dialers:monitor-activities › */proc/1/fddocker_lamp_12026-05-28 06:24:11 Runningjiminny:monitor-social-accounts]28/Маy/2026:06:24:08 +0000 "Gel /index.php" 500 /home/ Jiminoy-public/index.p5p 4[PHONE]6 wwwdocker_lamp_14s DONEdocker_lamp_1/1/fd/1', '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc2>81docker_lamp_10.1 -2026-05-28 06:24:16 Running ['artisan' mailbox:skip-lists:refresh] 127.0.28/May/2026:06:24:18 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4[PHONE]6 wwwdocker_1amp_11 . 7s DONEdocker_lamp_1 | , '/usr/local/bin/php' 'artisan'mailbox:skip-lists:refresh › */proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:24:24 Running ['artisan'mailbox:batch:process --max-batches=15]2s DONEdocker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=15 >'/proc/1/fd/1' 2>&1docker_lamp_1 |2026-05-28 06:24:26 Running ['artisan'conference:monitor:count]... 4s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan' conference:monitor:count › '/proc/1/fd/12>&1docker_lamp_1127.0.0.12026-05-28 06:24:30 Running ['artisan' activity:aircall:check-and-renew]28/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6 wwwdocker_lamp_13s DONEdocker_lamp_1l '/usr/local/bin/php' 'artisan' activity:aircall:check-and-renew > '/proc/1/fd/1'2>&1docker_1amp_12026-05-28 06:24:33 Running ['artisan'track:retry-failed-downloads]2sDONEdocker_lamp_1fd/1'l '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › */proc/1/2>&1docker_lamp_1docker_lamp_1I run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1| [IP_ADDRESS] -28/May/2026:06:24:37 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwDOCKER (docker-compose)screenpipe"O ₴4T2-zsh85...ip-10-30-129-190:~ (nc)PROD (ssh)S[URL_WITH_CREDENTIALS] (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks--MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.*** System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)~$0STAGEX 16FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ 0EXTENSIONView in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach...
|
NULL
|
-711604113829021638
|
NULL
|
click
|
ocr
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴8111DOCKER (docker-compose)DEV (docker)₴2-zsh883docker_lamp_12>&1docker_1amp_1ONE• '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot > */proc/1/fd/12026-05-28 06:24:07 Running ['artisan' dialers:monitor-activities] . 4s Dl '/usr/local/bin/php' 'artisan' dialers:monitor-activities › */proc/1/fddocker_lamp_12026-05-28 06:24:11 Runningjiminny:monitor-social-accounts]28/Маy/2026:06:24:08 +0000 "Gel /index.php" 500 /home/ Jiminoy-public/index.p5p 4[PHONE]6 wwwdocker_lamp_14s DONEdocker_lamp_1/1/fd/1', '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/proc2>81docker_lamp_10.1 -2026-05-28 06:24:16 Running ['artisan' mailbox:skip-lists:refresh] 127.0.28/May/2026:06:24:18 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4[PHONE]6 wwwdocker_1amp_11 . 7s DONEdocker_lamp_1 | , '/usr/local/bin/php' 'artisan'mailbox:skip-lists:refresh › */proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:24:24 Running ['artisan'mailbox:batch:process --max-batches=15]2s DONEdocker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=15 >'/proc/1/fd/1' 2>&1docker_lamp_1 |2026-05-28 06:24:26 Running ['artisan'conference:monitor:count]... 4s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan' conference:monitor:count › '/proc/1/fd/12>&1docker_lamp_1127.0.0.12026-05-28 06:24:30 Running ['artisan' activity:aircall:check-and-renew]28/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6 wwwdocker_lamp_13s DONEdocker_lamp_1l '/usr/local/bin/php' 'artisan' activity:aircall:check-and-renew > '/proc/1/fd/1'2>&1docker_1amp_12026-05-28 06:24:33 Running ['artisan'track:retry-failed-downloads]2sDONEdocker_lamp_1fd/1'l '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › */proc/1/2>&1docker_lamp_1docker_lamp_1I run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1| [IP_ADDRESS] -28/May/2026:06:24:37 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwDOCKER (docker-compose)screenpipe"O ₴4T2-zsh85...ip-10-30-129-190:~ (nc)PROD (ssh)S[URL_WITH_CREDENTIALS] (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks--MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.*** System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)~$0STAGEX 16FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ 0EXTENSIONView in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79302
|
2784
|
5
|
2026-05-28T06:24:45.176598+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949485176_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3756498949516846424
|
5771048316864018365
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute...
|
79301
|
NULL
|
NULL
|
NULL
|
|
79306
|
2784
|
9
|
2026-05-28T06:24:52.633062+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949492633_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
SELECT * FROM crm_fields WHERE id = 3014;
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"21","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;\nSELECT * FROM crm_fields WHERE id = 3014;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;\nSELECT * FROM crm_fields WHERE id = 3014;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
-2357953643595967711
|
6685203931303450205
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
SELECT * FROM crm_fields WHERE id = 3014;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79305
|
NULL
|
NULL
|
NULL
|
|
79307
|
2784
|
10
|
2026-05-28T06:24:53.494062+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949493494_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous 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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"21","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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}]...
|
-4799752145780111263
|
5771048317937760189
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79313
|
2784
|
16
|
2026-05-28T06:25:02.648788+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949502648_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes...
|
[{"role":"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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}]...
|
-5677551570005482419
|
5771048316864018365
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79314
|
2784
|
17
|
2026-05-28T06:25:05.685973+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949505685_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4913519257762175176
|
2897453187665953201
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴81DOCKER (docker-compose)DEV (docker)₴2-zsh883DOCKER (docker-compose)screenpipe"ONEdocker_lamp_1" '/usr/local/bin/php' 'artisan'dialers:monitor-activities > */proc/1/fd/1'2>&1docker_1amp_12026-05-28 06:24:11 Running ['artisan'jiminny:monitor-social-accounts][IP_ADDRESS]/May/2026:06:24:08 +0000 "GET /index.php"500/home/jiminny/public/index.php4[PHONE]6 wwwdocker_lamp_14S DONEdocker_lamp_1l '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts › '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:24:16 Running ['artisan'mailbox:skip-lists:refresh] [IP_ADDRESS] - 28/May/2026:06:24:18 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4906.31514336 wwwdocker_lamp_1docker_lamp_11 . 75 DONE• '/usr/local/bin/php' 'artisan'mailbox:skip-lists:refresh › */proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:24:24 Running ['artisan'mailbox:batch:process--max-batches=15]docker_lamp_1l '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 ›'/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:24:26 Running ['artisan'conference:monitor:count]... 45 DONEdocker_lamp_1 | , '/usr/local/bin/php' 'artisan'conference:monitor:count > '/proc/1/fd/12>&1docker_1amp_12026-05-28 06:24:30 Running ['artisan'activity:aircall:check-and-renew][IP_ADDRESS]/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6 wwwdocker_lamp_13S DONEdocker_lamp_1l '/usr/local/bin/php' 'artisan' activity:aircall:check-and-renew > '/proc/1/fd/1'2>&1docker_lamp_12026-05-28 06:24:33 Running ['artisan' track:retry-failed-downloads]25DONEdocker_lamp_1, '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › */proc/1/fd/1'2>&1docker_1amp_1docker_lamp_1run_artisan_schedule: Done waiting forschedule:rundocker_lamp_1| [IP_ADDRESS] -28/May/2026:06:24:37 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_11 [IP_ADDRESS] - 28/May/2026:06:24:45 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 3[PHONE]6 wwwdocker_lamp_1| [IP_ADDRESS] -28/May/2026:06:24:54 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 www84-zsh85...ip-10-30-129-190:~ (nc)T2PROD (ssh)S[URL_WITH_CREDENTIALS] (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-KovaliksMaсBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.*** System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)t6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ 0100% C47 8• Thu 28 May 9:25:05181886...-10-30-140-255:~ (-zsh)$7PRODSTAGEFRONTENDEXTENSIONView in Docker Desktopo View ConfigL View Logsw Enable Watchd Detach...
|
79313
|
NULL
|
NULL
|
NULL
|
|
79315
|
2785
|
9
|
2026-05-28T06:25:05.788762+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949505788_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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}]...
|
-7228688528716742632
|
2609222811515291121
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
PhpStormViewFV faVsco.|s ~$ JY-20915-fix-mlCoocRurToolWindowKerodloh© SyncMailbox.phpMockeriitlaravel.logSF (iminny@localhost) xconedia PereA console (EU)Einfection ison distTextRelayServiceTest.phpphp fiminny.phgMAINTERNAL_WEBHOOK SETUP.mdjiminny_storagewulicancas maMMakerd0 package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phpunit.xmlRraw_sal.query.soMAPCAOMS mafê sonar-proiect-propertiesEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWICONDAY CITZONG IMORNZUTAY> h Extemal Librariesv Eg Scratches and Consolesv E Database Consolesconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowtoes oeAN fiiminovAlocalbosttwsweslitiiminowoesnnehASE fliminnvAlocslboett& zoho_dev jiminny@localhost)• Аpроn#concalo ropontServico,+o₫v MDatabas,V AEUA consoleS:758 mdA HSLlocalvonelV CTAGNGrancaloTnastorclass Field extends Modelconsole (STAGINGA42Do jminny022 A1 A18 V2 V6 Ause RequiresUUIduse Enunsselect * fron crn_configurations where provider = Oipedrave':public const int NAME MAX_LENGTH = 128oublic const int LABEL MAXLENGTH = 255:E25e252253CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE •* END) AS user_idoublic const sint DESCRIPTION MAX_LENGTH = 191;U.chsst,sa.*,t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJOIN teams t 1.n<->1: on t.id = u.tean_idWHERE u.tean_id = 19 and sa.provider = 'pipednive':public const string TYPE_MULTIPICKLIST = 'nulti-picklist';I Not vet supportedoublie const stoing TYPE PERCENTI257258=260E261SELECT * FROM social accounts WHERE id = 1116:UPDATE social. accounts SET provider user token = *viu:AOIBAHS-L2TNK2yuuuaLoffzhWb9crUNKTok4F109cinXqp_6AE0hDhDOVa1nviCHEvnp)qubsic const string ipE PriKESTexpires = 1779891997,nuhite conet sranewpr wieeshWHERE id = 1116:nuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivosh"orovider_user_token". "vlu:AOTBAH1-L2TNK2yuuuaLoifzh#b9crUNKTok4F109rinXop_6AE0h0h00Va1nvWCHEynpvSEAAAAf1B8Bqkchk#69a9BBи:"orovider refreshtoken": "5034113:19555731-87c1425848c813d82767ee975f6044d46b6b2bfc*=268nhile conet etaiinauivor10select * Fron ern Field valuespublic const string TYPE DATEselect * from eon fields where tvoe = "nultcoickuistepublic const string TYPE DATETIMESE * FROX Con LaVOuTS WHERE UUSA TO DINC 7CY487++025-4050-9884-44058849865601 8 uuSdSELECT * EROM eon Sseldi values WHEDE con Siela 3a = SGLECT + EROM enn £selde WHERE 30 = 3012•0public const string OBJECT LEAdoublic const stoing OBJECT ACCOUNT"account"7 Output84 roursR1d Ttii jiminny.crm.fieldsThe AutoдQQEA®(Muuid (UUID with time-low and time-high swapped) YAn com confiquration id y :2527 87593011-6d28-4614-a631-69602a82c39925463ecShedh-5c68-4h4a-925c-7edf9heh0a1,2547 AX0R4d67-6161-4401-8692-101876278029era provider id ?g label v2 hs tao.id,he usen iae. of all notification follouendDeal. TagsJisen the oe ainl nor tearion tolnlorend2he mean Sae of all not44teation unfollomoneUser IDs of all notification unfollowers2548 2ff60785-64b7-4f63-b8ba-387614678634Z01? 1291600d.D4T4-1A-9hAL-RROGhEnAE,2 hs-user_ids_of_all owners39 picktestmultilc3014 a303d6Sa-0881-43d8-695e-1f£4bec8c4283314 c199159-coff-4685-ac9c-85d7A6f48a0s39 picktestaula2 hs shaced tean stadUser IDs of all ounerspicktestaultilpicktestaulalShared teansX74GA0d02062-1044-4990-9470-2026d671462,nhe chanad neanhdChanod neoneXle Mhlkaaco Con elsahahehdtathatooXozz eocgonge, ched.nnk.Oond, OunnnkanAhed2 hs ouning teans2 hs keywordsOwning TeansCompany KeywordsTO0УLYThu 28 May 9:25:05TextRelayServiceTestaer henseict+0.can I test it locally first. if I place env from stagingYes. The service relies on a few things you'd need in place1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXT HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.com# the Pub/Sub topic nam# eu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10leosstnaegdocker exec -it docker_lamp_1 php artisan tinkerapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and a spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnentorectly via tinker to verity the header logic without disaatchine amvthinotioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sowService=ssvc-soetServicelconttatainny.google text user"Ask anuthind (2A1§ Adaptive@ description YList of tag ids applicable to a deal. This property is set automatically by HubSpotThe user IDs of all users that have clicked follow within the object to opt-in to getting follow notificationsCSVy20+.09: D type Ynupeoickostnulti-picklistThe user Ils of all object ouners that have clicked unfollow within the object to opt-out of getting follow noti.The user Ils of all ouners of this record.konlsmulti-picklistnulti-picklistnultil-picklistcnulnultsi-picktistAdo cional teans wose usens con access the benl based on thein permissions. Thiis can be ser mnuslly on thnoughnults-pickttetAdditional users that can access the Deal based on their permissions. This can be set manually or through workfeenhehhehThe teams that are attributed to this record.nulti-picklistA List of company vertical descriptors. Typically more granular than industry classificationnulti-picklistO7GOK, LITE...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79316
|
2785
|
10
|
2026-05-28T06:25:09.227721+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949509227_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
SELECT * FROM crm_fields WHERE id = 3014;
SELECT * FROM crm_field_values WHERE crm_field_id = 3014;;
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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":"42","depth":4,"bounds":{"left":0.375,"top":0.10055866,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.38730052,"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.39694148,"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.40425533,"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\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41289893,"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.42154256,"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.4325133,"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.44115692,"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.44980052,"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.46077126,"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.47174203,"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.49833778,"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.5093085,"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.7237367,"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":"22","depth":4,"bounds":{"left":0.68650264,"top":0.123703115,"width":0.009973404,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.6984708,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"bounds":{"left":0.7077792,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"bounds":{"left":0.7194149,"top":0.123703115,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","depth":4,"bounds":{"left":0.7293883,"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.7390292,"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.7463431,"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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;\nSELECT * FROM crm_fields WHERE id = 3014;\nSELECT * FROM crm_field_values WHERE crm_field_id = 3014;;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;\nSELECT * FROM crm_fields WHERE id = 3014;\nSELECT * FROM crm_field_values WHERE crm_field_id = 3014;;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
-26732230516532190
|
6685203931320227421
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
SELECT * FROM crm_fields WHERE id = 3014;
SELECT * FROM crm_field_values WHERE crm_field_id = 3014;;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
79315
|
NULL
|
NULL
|
NULL
|
|
79317
|
2784
|
18
|
2026-05-28T06:25:09.337259+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949509337_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":"22","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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}]...
|
-5164500315210545022
|
5807041929510893501
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
22
1
18
2
6
Previous Highlighted Error
Next Highlighted Error...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79318
|
2785
|
11
|
2026-05-28T06:25:11.809119+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949511809_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormViewFV faVsco.s$ JY-20915-fix-mlCoocTOOI-W PhpStormViewFV faVsco.s$ JY-20915-fix-mlCoocTOOI-WindowKemelonp© SyncMailbox.phpMockeriitaraveliosSF (iminny@localhost)xconedia Pere# consolefFulEinfection ison distMENSTAmMAINTERNAL_WEBHOOK SETUP.mdjiminny_storagewulicancas maMMakerd0 package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phpunit.xmlRraw_sal.query.soMAPCAOMS mafê sonar-proiect-propertiesEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWCONDAN CIYRONG MMORNRNRIT> 1h Extemal Librariesv Eg Scratches and Consolesv E Database ConsolesTextRelayServiceTest.phpPyyminny.onconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowtoes oeAN fiiminovAlocalbostt2 HS.Jlocal jiminny@localhostASE fliminnvAlocslboett& zoho_dev fiminny@localhost• Аpроn#concalo ropontServico,+o₫v MDatabas,V AEUA consoleyliminny@loch nostS:758 mdA HSLlocalvonelV CTAGNGrancaloTnastorclass Field extends Modeluse RequiresUUIduse EnunsA console (STAGINGWwweAVDA009-247248= 250select * fron crn_configurations where provider = Oipedrave':Do jminnyUaalalyzyoCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE •* END) AS user_idpublic const int NAME MAX_LENGTH = 128oublic const int LABEL MAXLENGTH = 255:252oublic const sint DESCRIPTION MAXLENGTH = 191;U.chsst,sa.*t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJOIN teams t 1.n<->1: on t.id = u.tean_idWHERE u.team_id = 19 and sa.provider = 'pipednive':public const string TYPE_MULTIPICKLIST = 'nulti-picklist';I Not vet supportedoub1ie const string TYPE PERCENTIpercent256257258=260E261SELECT * FROM social accounts WHERE id = 1116:UPDATE social. accounts SET provider user token = *viu:AOIBAHS-L2TNK2yuuuaLoffzhWb9crUNKTok4F109cinXqp_6AE0hDhDOVa1nviCHEvnp)qubsic const stoind NpE PriKesTexpires = 1779891997,nuhite conet sranewpr wieeshWHERE id = 1116:nuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivosh"orovider user_token". "vlu:AOTBAH1-L2TNK2yuuuaLoifzh#b9crUNKTok4F109rinXop_6AE0h0h00Va1nvWCHEynpvSEAAAAf1B8Bqkchk#69a9BBw:"orovider refreshtoken": "5034113:19555731-87c1425848c813d82767ee975f6044d46b6b2bfc*=268nhile conet etaiinauivor10select * fron ern sield valuespublic const string TYPE DATEpublic const string TYPE DATETIMEpublic const string TYPE UNSUPPORTED = *unsupported":select * from eon fields where tvoe = "nultcoickuisteSELECT * FROM crn_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a8f-44C5a849d65c') = uuid;SELECT * FROM crn_field_values WHERE crn_field_id = 3014public const string OBJECT LEAGoublic const stoing OBJECT ACCOUNT"account"7 Outputtii jiminny.crm.fields84 roursRid YдQQEA®(Muuid (UUID with time-low and time-high swapped) YAn com confiquration id y :Am cra provider id2527 87593011-6d28-4614-a631-69602a82c39925463ecShedh-5c68-4h4a-925c-7edf9heh0a1,2 hs tao.id,he usen iae. of all notification follouendg label vDeal. TagsUser Is of all notification followers2547 AX0R4d67-6161-4401-8692-1018762780292hs_user_ids_of_all_notification_unfollowersUser IDs of all notification unfollowers2548 2ff60785-64b7-4f63-b8ba-387614678634Z01? 1291600d.D4T4-1A-9hAL-RROGhEnAE,3014 a303d6Sa-0881-43d8-695e-1f£4bec8c4283314 c199159-coff-4685-ac9c-85d7A6f48a0s2 hs-user_ids_of_all owners39 picktestmultilc39 picktestaulae2 hs shaced tean stadUser IDs of all ounersDCKIeSEURepicktestaulalShared teansX74GA0d02062-1044-4990-9470-2026d671462,nhe chanad neanhdChanod neoneXle Mhlkaaco Con elsahahehdtathatooXozz eocgonge, ched.nnk.Oond, OunnnkanAhed2 hs ouning teans2 hs keywordsOwning TeansCompany KeywordsTO0УLYThu 28 May 9:25:11TextRelayServiceTestner hensewiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a few things you'd need in place1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.com# the Pub/Sub topic nam# eu or us3. Run the sync manually via tinker (inside docker_lanp_1 ):eosstnaegdocker exec -it docker_lamp_1 php artisan tinkerapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and a spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnentorectly via tinker to verity the header logic without disaatchine amvthinotioh.Ssvc = new class extends \Jiminny|Services\Mail\TextRelayService & public function _construct(sowServiceassvc-soetServicelconttatainny.google text user"Ask anuthind (2A1§ AdaptiveW description YList of tag ids applicable to a deal. This property is set autonatically by HubSpotCSVyДus.00: D type YnupeoickostThe user IDs of all users that have clicked follow within the obnect to opt-in to getting follow notificationsnulti-picklistThe user Ils of all object ouners that have clicked unfollow within the object to opt-out of getting follow noti.The user Ils of all ouners of this record.konlsmulti-picklistnulti-picklistnultil-picklistcnulnultsi-picktistAdo cional teans wose usens con access the benl based on thein permissions. Thiis can be ser mnuslly on thnoughnults-pickttetAdditional users that can access the Deal based on their permissions. This can be set manually or through WorkfeenhehhehThe teams that are attributed to this record.nulti-picklistA List of company vertical descriptors. Typically more granular than industry classificationnulti-picklist275:57...
|
NULL
|
-1831302985886233372
|
NULL
|
typing_pause
|
ocr
|
NULL
|
PhpStormViewFV faVsco.s$ JY-20915-fix-mlCoocTOOI-W PhpStormViewFV faVsco.s$ JY-20915-fix-mlCoocTOOI-WindowKemelonp© SyncMailbox.phpMockeriitaraveliosSF (iminny@localhost)xconedia Pere# consolefFulEinfection ison distMENSTAmMAINTERNAL_WEBHOOK SETUP.mdjiminny_storagewulicancas maMMakerd0 package-lock.jsonEphpstan.neon.distE phpstan-baseline.ncon<>phpunit.xmlRraw_sal.query.soMAPCAOMS mafê sonar-proiect-propertiesEtest.ov<> Untitied Diagram.xmlis vetur.confialisMWCONDAN CIYRONG MMORNRNRIT> 1h Extemal Librariesv Eg Scratches and Consolesv E Database ConsolesTextRelayServiceTest.phpPyyminny.onconsole iauADEAL RISKS (EUFDTEUEUTEUvm anuchdes nochconsola timinowtoes oeAN fiiminovAlocalbostt2 HS.Jlocal jiminny@localhostASE fliminnvAlocslboett& zoho_dev fiminny@localhost• Аpроn#concalo ropontServico,+o₫v MDatabas,V AEUA consoleyliminny@loch nostS:758 mdA HSLlocalvonelV CTAGNGrancaloTnastorclass Field extends Modeluse RequiresUUIduse EnunsA console (STAGINGWwweAVDA009-247248= 250select * fron crn_configurations where provider = Oipedrave':Do jminnyUaalalyzyoCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE •* END) AS user_idpublic const int NAME MAX_LENGTH = 128oublic const int LABEL MAXLENGTH = 255:252oublic const sint DESCRIPTION MAXLENGTH = 191;U.chsst,sa.*t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJOIN teams t 1.n<->1: on t.id = u.tean_idWHERE u.team_id = 19 and sa.provider = 'pipednive':public const string TYPE_MULTIPICKLIST = 'nulti-picklist';I Not vet supportedoub1ie const string TYPE PERCENTIpercent256257258=260E261SELECT * FROM social accounts WHERE id = 1116:UPDATE social. accounts SET provider user token = *viu:AOIBAHS-L2TNK2yuuuaLoffzhWb9crUNKTok4F109cinXqp_6AE0hDhDOVa1nviCHEvnp)qubsic const stoind NpE PriKesTexpires = 1779891997,nuhite conet sranewpr wieeshWHERE id = 1116:nuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivosh"orovider user_token". "vlu:AOTBAH1-L2TNK2yuuuaLoifzh#b9crUNKTok4F109rinXop_6AE0h0h00Va1nvWCHEynpvSEAAAAf1B8Bqkchk#69a9BBw:"orovider refreshtoken": "5034113:19555731-87c1425848c813d82767ee975f6044d46b6b2bfc*=268nhile conet etaiinauivor10select * fron ern sield valuespublic const string TYPE DATEpublic const string TYPE DATETIMEpublic const string TYPE UNSUPPORTED = *unsupported":select * from eon fields where tvoe = "nultcoickuisteSELECT * FROM crn_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a8f-44C5a849d65c') = uuid;SELECT * FROM crn_field_values WHERE crn_field_id = 3014public const string OBJECT LEAGoublic const stoing OBJECT ACCOUNT"account"7 Outputtii jiminny.crm.fields84 roursRid YдQQEA®(Muuid (UUID with time-low and time-high swapped) YAn com confiquration id y :Am cra provider id2527 87593011-6d28-4614-a631-69602a82c39925463ecShedh-5c68-4h4a-925c-7edf9heh0a1,2 hs tao.id,he usen iae. of all notification follouendg label vDeal. TagsUser Is of all notification followers2547 AX0R4d67-6161-4401-8692-1018762780292hs_user_ids_of_all_notification_unfollowersUser IDs of all notification unfollowers2548 2ff60785-64b7-4f63-b8ba-387614678634Z01? 1291600d.D4T4-1A-9hAL-RROGhEnAE,3014 a303d6Sa-0881-43d8-695e-1f£4bec8c4283314 c199159-coff-4685-ac9c-85d7A6f48a0s2 hs-user_ids_of_all owners39 picktestmultilc39 picktestaulae2 hs shaced tean stadUser IDs of all ounersDCKIeSEURepicktestaulalShared teansX74GA0d02062-1044-4990-9470-2026d671462,nhe chanad neanhdChanod neoneXle Mhlkaaco Con elsahahehdtathatooXozz eocgonge, ched.nnk.Oond, OunnnkanAhed2 hs ouning teans2 hs keywordsOwning TeansCompany KeywordsTO0УLYThu 28 May 9:25:11TextRelayServiceTestner hensewiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a few things you'd need in place1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.com# the Pub/Sub topic nam# eu or us3. Run the sync manually via tinker (inside docker_lanp_1 ):eosstnaegdocker exec -it docker_lamp_1 php artisan tinkerapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and a spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnentorectly via tinker to verity the header logic without disaatchine amvthinotioh.Ssvc = new class extends \Jiminny|Services\Mail\TextRelayService & public function _construct(sowServiceassvc-soetServicelconttatainny.google text user"Ask anuthind (2A1§ AdaptiveW description YList of tag ids applicable to a deal. This property is set autonatically by HubSpotCSVyДus.00: D type YnupeoickostThe user IDs of all users that have clicked follow within the obnect to opt-in to getting follow notificationsnulti-picklistThe user Ils of all object ouners that have clicked unfollow within the object to opt-out of getting follow noti.The user Ils of all ouners of this record.konlsmulti-picklistnulti-picklistnultil-picklistcnulnultsi-picktistAdo cional teans wose usens con access the benl based on thein permissions. Thiis can be ser mnuslly on thnoughnults-pickttetAdditional users that can access the Deal based on their permissions. This can be set manually or through WorkfeenhehhehThe teams that are attributed to this record.nulti-picklistA List of company vertical descriptors. Typically more granular than industry classificationnulti-picklist275:57...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79319
|
2784
|
19
|
2026-05-28T06:25:12.367103+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949512367_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴81DEV (docker)₴2-zsh88311DOCKER (docker-compose)docker_lamp_1l '/usr/local/bin/php' "artisan'jiminny:monitor-social-accounts > */proc/1/fd/1'2>&1docker_lamp_10.128/May/2026:06:24:182026-05-28 06:24:16 Running ['artisan'mailbox:skip-lists:refresh] 127.0.+0000 "GET /index.php"500 /home/jiminny/public/index.php4906.31514336 wwwdocker_lamp_11 . 7s DONEdocker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:skip-lists:refresh ›'/proc/1/fd/1'2>81docker_1amp_12026-05-28 06:24:24 Running ['artisan'mailbox:batch:process--max-batcheS=15]2S DONEdocker_lamp_1'/proc/1/fd/1'l '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 >2>&1docker_lamp_12026-05-28 06:24:26 Running ['artisan'conference:monitor:count]... 4s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'conference:monitor:count > */proc/1/fd/12>&1docker_lamp_12026-05-28 06:24:30 Running ['artisan'activity:aircall:check-and-renew][IP_ADDRESS]/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6 wwwdocker_lamp_1docker_lamp_1c/1/fd/1'l '/usr/local/bin/php' 'artisan' activity:aircall:check-and-renew > '/pro2>&1docker_lamp_12026-05-28 06:24:33 Running ['artisan' track:retry-failed-downloads]25DONEdocker_lamp_1fd/1'1 '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › '/proc/1/2>&1docker_lamp_1docker_lamp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1| [IP_ADDRESS] -public/index.php 2[PHONE]6 www2[PHONE]28 May/2026:06:24:37 +8000 schedule:ru28/May/2026:06:24:37 +0000 "GET /index.php" 500 /home/jiminny/docker_lamp_1| [IP_ADDRESS]/May/2026:06:24:45 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 3[PHONE]6 wwwdocker_lamp_1| [IP_ADDRESS]/May/2026:06:24:54 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_11 [IP_ADDRESS] -28/May/2026:06:25:01 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4025.648 14336 wwwdocker_1amp_1docker_lamp_12026-05-28 06:25:06 Running ['artisan' meeting-bot:schedule-bot] ... 2s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot> */proc/1/fd/12>&1DOCKER (docker-compose)screenpipe"С *4-zsh85...ip-10-30-129-190:~ (nc)T2PROD (ssh)S[URL_WITH_CREDENTIALS] 13EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)X 16FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ 0100% C47 8• Thu 28 May 9:25:12181886...-10-30-140-255:~ (-zsh)$7PRODSTAGEFRONTENDEXTENSION...
|
NULL
|
2534913172624639708
|
NULL
|
typing_pause
|
ocr
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER₴81DEV (docker)₴2-zsh88311DOCKER (docker-compose)docker_lamp_1l '/usr/local/bin/php' "artisan'jiminny:monitor-social-accounts > */proc/1/fd/1'2>&1docker_lamp_10.128/May/2026:06:24:182026-05-28 06:24:16 Running ['artisan'mailbox:skip-lists:refresh] 127.0.+0000 "GET /index.php"500 /home/jiminny/public/index.php4906.31514336 wwwdocker_lamp_11 . 7s DONEdocker_lamp_1• '/usr/local/bin/php' 'artisan'mailbox:skip-lists:refresh ›'/proc/1/fd/1'2>81docker_1amp_12026-05-28 06:24:24 Running ['artisan'mailbox:batch:process--max-batcheS=15]2S DONEdocker_lamp_1'/proc/1/fd/1'l '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 >2>&1docker_lamp_12026-05-28 06:24:26 Running ['artisan'conference:monitor:count]... 4s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'conference:monitor:count > */proc/1/fd/12>&1docker_lamp_12026-05-28 06:24:30 Running ['artisan'activity:aircall:check-and-renew][IP_ADDRESS]/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6 wwwdocker_lamp_1docker_lamp_1c/1/fd/1'l '/usr/local/bin/php' 'artisan' activity:aircall:check-and-renew > '/pro2>&1docker_lamp_12026-05-28 06:24:33 Running ['artisan' track:retry-failed-downloads]25DONEdocker_lamp_1fd/1'1 '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › '/proc/1/2>&1docker_lamp_1docker_lamp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1| [IP_ADDRESS] -public/index.php 2[PHONE]6 www2[PHONE]28 May/2026:06:24:37 +8000 schedule:ru28/May/2026:06:24:37 +0000 "GET /index.php" 500 /home/jiminny/docker_lamp_1| [IP_ADDRESS]/May/2026:06:24:45 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 3[PHONE]6 wwwdocker_lamp_1| [IP_ADDRESS]/May/2026:06:24:54 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_11 [IP_ADDRESS] -28/May/2026:06:25:01 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4025.648 14336 wwwdocker_1amp_1docker_lamp_12026-05-28 06:25:06 Running ['artisan' meeting-bot:schedule-bot] ... 2s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot> */proc/1/fd/12>&1DOCKER (docker-compose)screenpipe"С *4-zsh85...ip-10-30-129-190:~ (nc)T2PROD (ssh)S[URL_WITH_CREDENTIALS] 13EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)X 16FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lX 17EXT (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ 0100% C47 8• Thu 28 May 9:25:12181886...-10-30-140-255:~ (-zsh)$7PRODSTAGEFRONTENDEXTENSION...
|
79317
|
NULL
|
NULL
|
NULL
|
|
79320
|
2785
|
12
|
2026-05-28T06:25:14.640979+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949514640_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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}]...
|
-7334512262672537281
|
-8780802033898552894
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
PhpStormViewCoocRurToolWindowFV faVsco.|s ~$ JY-20915-fix-mis:Kemelonp© SyncMailbox.phpEinfection ison disTextRelayServiceTest.phpMENSTAmMAINTERNAL_WEBHOOK SETUP.mdjiminny_storagewulicancas maM Makefile# package-lock.jsonE phpstan.neon.distEphpstan-baseline.neon<>phounit.xml18 raw.sal.query.solM:README.mdô sonar-proiect propertiesEtest.ovSUn tieo aciam-xmiis vetur.confialisM.WEBHOOK_FILTERING.IMPLEMENTAT> 1h Extemal Librariesv E Scratches and Consolesv M Database Consolesconsole iauDEALRSKS TEUDTEUEUTEUvm anuctden noehconsola timinowsoes roeAN fiiminovAlocalbostt2 HS.Jlocal jiminny@localhosttiminoutioeainden& zoho_dev fiminny@localhostyewel#concalo ropontServicos+o₫v MDatabas,consoleyliminny@loch nostS:1s314mA HSLlocalcancaloN CTAGING# consoleTnastorPyyminny.onclass Field extends Modeluse RequiresUUIdUse cnunswoe constnwanichohsooublic const int LABEL MAXLENGTH = 255:oublic const sint DESCRIPTION MAXLENGTH = 191;public const string TYPE_HULIIPICKLIST = "nuLti-pickList"ENot vet supportedoub1ie const string TYPE PERCENTIpercentqubsic const string ipE PriKESTnuhite conet sranewpr wieeshnuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivoshpublic const string TYPE_PHONEnhile conet etaiinauivor10public const string TYPE DATEpublic const string TYPE TIMEpublic const string TYPE DATETIMEpublic const string TYPE UNSUPPORTED = *unsupported':public const string OBJECT LEAGoublic const stoing OBJECT ACCOUNT7) Outputtit jiminny.crm field. valuesGi:wSrows5 0wridy(m uuid UUID with tine-low and time-h_BQEAAG7: ern field id yO00 [CREDIT_CARD] HAHA CRAGARROGAR44801 6796ad28-7b4b-468a-9369-34aced141927hine accea.oscnec/chhoattanhariih44883 18db6888-48a2-4719-b76e-899d7f8abb24ALARZ ZZORAdA-ARI1-/RAS-079/-CCA7ZAАCANАMockeriitcustom.loglaravel.logSF (iminny@localhost) xconedia PereA console (EU)console (STAGINGA42Do jminnyE 250252257258E 262=268021 A1 A18 V2 Y6 Aselect * fron crn_configurations where provider = Oipedrave':CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE •* END) AS user_idsa.*t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJINTM tasee+uncosi:ontid = mteanfoWHERE U.tean_id = 19 and sa.provider = 'pipedrive":SELECT * FROM social accounts WHERE id = 1116:UPDATE social. accounts SET provider user token = *viu:AOIBAHS-L2TNK2yuuuaLoffzhWb9crUNKTok4F109cinXqp_6AE0hDhD0Va1nviCHEvnp)expires = 1779891997WHERE id = 1116:"orovider_user_token". "vlu:AOTBAH1-L2TNK2yuuuaLoifzh#b9crUNKTok4F109rinXop_6AE0h0h00Va1nvWCHEynpvSEAAAAf1B8Bqkchk#69a9BBи:"orovider refreshtoken". "5034113:19555731-87c1425848c813d82767ee975f6044d46b6b2bfc**select * Fron ern Field valuesselect * from eon fields where tvoe = "nultcoickuisteSELECT * FRON con layouts WHERE uufd to bin(+7c327871-4625-4056-9a8f-44cSa849d65c') = uujd:≤®Ест + БRON сnn £ielde WHERE 30 - 39142SELECT * EROM eon Sseldi values WHEDE con flela 3a = 791d,Im value "3014 ny value ond3014 my value tao3014 ey valueThnes3014 ay valuefour3014 ew valuIlabelVny value oncsequence Yis defaut ?ny value twony valme Thnedny value fourew walms fivdIDcreated at w64044-00.40 44.012408 2926-92-19 11:01:198. 2826-82-10 11-81-188 2026-02-10 11:01:10A2024-02.1A 11-01-10I updated at2026-02-10 11:01:162026-82-10 11:81:162926-92-18 11-910162026-02-10 11:01:102024-02.19 11-91-19TO0%L7Thu 28 May 9:25:14TextRelayServiceTesteeendhrner hensewiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXT HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail nailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10lb bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnant orectly via tinker to verity the header logic without disaatchine amvthinotioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthind (2A1§ AdaptiveCSVyđu5.00NO MMald Tosme 27567 lTS8ensd...
|
79318
|
NULL
|
NULL
|
NULL
|
|
79321
|
2784
|
20
|
2026-05-28T06:25:20.062160+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949520062_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp100% C47 • Thu 28 May 9:25:19• 0DOCKER₴81DEV (docker)₴2-zsh88311DOCKER (docker-compose)docker_lamp_1• '/usr/local/bin/php' 'artisan'conference:monitor:count > */proc/1/fd/12>&1docker_lamp_12026-05-28 06:24:30 Running ['artisan'activity:aircall:check-and-renew][IP_ADDRESS]/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6docker_lamp_1docker_lamp_1• '/usr/local/bin/php' 'artisan'activity:aircall:check-and-renew> '/proc/1/fd/1'2>&1docker_1amp_12026-05-28 06:24:33 Running ['artisan'track:retry-failed-downloads]2sDONEdocker_lamp_1fd/1'l '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › */proc/1/2>&1docker_lamp_1docker_1amp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1127.0.0.1 -28/May/2026:06:24:37+0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_1| [IP_ADDRESS]/May/2026:06:24:45+0000 "GET /index.php" 500 /home/jiminny/public/index.php 3[PHONE]6 wwwdocker_lamp_128/May/2026:06:24:54 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_1| [IP_ADDRESS] -28/May/2026:06:25:01 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4025.648 14336 wwwdocker_lamp_1docker_1amp_12026-05-28 06:25:06 Running ['artisan'meeting-bot: schedule-bot]... 2s DONEdocker_lamp_1, '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot › */proc/1/fd/12>&1docker_lamp_12026-05-28 06:25:09 Running ['artisan' dialers:monitor-activities] . 7s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › */proc/1/fd/1' 2>81docker_lamp_12026-05-28 06:25:16 Running ['artisan'jiminny:monitor-social-accounts] [IP_ADDRESS] -28/May/2026:06:25:10 +0000 "GET /index.php" 500 /home/jiminny/public/index.php6[PHONE]6 wwwdocker_lamp_12S DONEdocker_1amp_1l '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts › '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:25:18 Running ['artisan' mailbox:skip-lists:refresh] . 1s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › */proc/1/fd/1' 2>81DOCKER (docker-compose)screenpipe"O ₴4-zsh85...ip-10-30-129-190:~ (nc)XIT2PROD (ssh)Seehttps://ubuntu.com/esm or run: sudo pro status181V View in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach886...-10-30-140-255:~ (-zsh)$7PROD*** System restart required ***Last login: Tue May 26 12:25:05 2026 from 212.5.153.87lukas@jiminny-prod-bastion:~$X T3 EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.STAGE*** System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)t6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDX 17EXT (-zsh)ukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ 0EXTENSION...
|
NULL
|
6262043027273996312
|
NULL
|
click
|
ocr
|
NULL
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp100% C47 • Thu 28 May 9:25:19• 0DOCKER₴81DEV (docker)₴2-zsh88311DOCKER (docker-compose)docker_lamp_1• '/usr/local/bin/php' 'artisan'conference:monitor:count > */proc/1/fd/12>&1docker_lamp_12026-05-28 06:24:30 Running ['artisan'activity:aircall:check-and-renew][IP_ADDRESS]/May/2026:06:24:28 +0000 "GET /index.php" 500 /home/jiminny/public/index.php3[PHONE]6docker_lamp_1docker_lamp_1• '/usr/local/bin/php' 'artisan'activity:aircall:check-and-renew> '/proc/1/fd/1'2>&1docker_1amp_12026-05-28 06:24:33 Running ['artisan'track:retry-failed-downloads]2sDONEdocker_lamp_1fd/1'l '/usr/local/bin/php' 'artisan' track:retry-failed-downloads › */proc/1/2>&1docker_lamp_1docker_1amp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1127.0.0.1 -28/May/2026:06:24:37+0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_1| [IP_ADDRESS]/May/2026:06:24:45+0000 "GET /index.php" 500 /home/jiminny/public/index.php 3[PHONE]6 wwwdocker_lamp_128/May/2026:06:24:54 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 2[PHONE]6 wwwdocker_lamp_1| [IP_ADDRESS] -28/May/2026:06:25:01 +0000 "GET /index.php" 500 /home/jiminny/public/index.php 4025.648 14336 wwwdocker_lamp_1docker_1amp_12026-05-28 06:25:06 Running ['artisan'meeting-bot: schedule-bot]... 2s DONEdocker_lamp_1, '/usr/local/bin/php' 'artisan'meeting-bot:schedule-bot › */proc/1/fd/12>&1docker_lamp_12026-05-28 06:25:09 Running ['artisan' dialers:monitor-activities] . 7s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › */proc/1/fd/1' 2>81docker_lamp_12026-05-28 06:25:16 Running ['artisan'jiminny:monitor-social-accounts] [IP_ADDRESS] -28/May/2026:06:25:10 +0000 "GET /index.php" 500 /home/jiminny/public/index.php6[PHONE]6 wwwdocker_lamp_12S DONEdocker_1amp_1l '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts › '/proc/1/fd/1' 2>&1docker_lamp_12026-05-28 06:25:18 Running ['artisan' mailbox:skip-lists:refresh] . 1s DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › */proc/1/fd/1' 2>81DOCKER (docker-compose)screenpipe"O ₴4-zsh85...ip-10-30-129-190:~ (nc)XIT2PROD (ssh)Seehttps://ubuntu.com/esm or run: sudo pro status181V View in Docker Desktop@ View ConfigL View Logsw Enable Watchd Detach886...-10-30-140-255:~ (-zsh)$7PROD*** System restart required ***Last login: Tue May 26 12:25:05 2026 from 212.5.153.87lukas@jiminny-prod-bastion:~$X T3 EU (-zsh)*** System restart required ***Last login: Tue May 26 06:32:33 2026 from 212.5.153.87lukas@jiminny-eu-bastion:~$ client_loop: send disconnect: Broken pipe@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (ssh)Run 'do-release-upgrade' to upgrade to it.STAGE*** System restart required ***Last login: Mon May 18 06:46:53 2026 from 212.5.153.87tion:~$ |XIT5QA (-zsh)t6FE (-zsh)lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lFRONTENDX 17EXT (-zsh)ukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ 0EXTENSION...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79323
|
2785
|
13
|
2026-05-28T06:25:19.920658+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949519920_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormViewCoocRurToolWindowFV faVsco.|s ~$ JY-20 PhpStormViewCoocRurToolWindowFV faVsco.|s ~$ JY-20915-fix-mis:Kemelonp© SyncMailbox.phpEinfection ison distTextRelayServiceTest.phpMENSTAmMAINTERNAL_WEBHOOK SETUP.mdjiminny_storagewulicancas maM Makefile# package-lock.jsonE phpstan.neon.distEphpstan-baseline.neon<>phounit.xml1% raw.salquery.salM:README.mdô sonar-proiect propertiesEtest.ovwo on teo Mractom-xmlis vetur.confialisM.WEBHOOK_FILTERING.IMPLEMENTAT> 1h Extemal Librariesv E Scratches and Consolesv M Database Consolesconsole iauDEALRSKS TEUDTEUEUTEUvm anuctden noehconsola timinowsoes roeAN fiiminovAlocalbostt2 HS.Jlocal jiminny@localhosttiminoutioeainden& zoho_dev jiminny@localhost)yewel#concalo ropontServicos+o₫v MDatabas,consoleyliminny@loch nostS:1s314mA HSLlocalcancaloN CTAGING# consoleTnastorPyyminny.onclass Field extends Modeluse RequiresUUIdUse cnunswoe constnwanichohsooublic const int LABEL MAXLENGTH = 255:oublic const sint DESCRIPTION MAXLENGTH = 191;public const string TYPE_HULIAPICKLIST = "nuLti-picklist"ENot vet supportedoub1ie const string TYPE PERCENTIpercentqubsic const string ipE PriKESTnuhite conet sranewpr wieeshnuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivoshpublic const string TYPE_PHONEnhile conet etaiinauivor10public const string TYPE DATEpublic const string TYPE TIMEpublic const string TYPE DATETIMEpublic const string TYPE UNSUPPORTED = *unsupported'=public const string OBJECT LEAGoublic const stoing OBJECT ACCOUNT7) Outputtit jiminny.crm field. valuesGi:wSrowsQMEA0wridy(m uuid UUID with tine-low and time-h_y: wcrn field id yO00 [CREDIT_CARD] HAHA CRAGARROGAR44801 6796ad28-7b4b-468a-9369-34aced141927hine accea.oscnec/chhoattanhariih44883 18db6888-48a2-4719-b76e-899d7f8abb24ALARZ ZZORAdA-ARI1-/RAS-079/-CCA7ZAАCANАMockeriit=custom.logaraveliosSF (iminny@localhost) xconedia Pere# console FulA console (STAGINGTwWLAV-24т248252253256257258=260E261=268TeAuto vDo jminny021 A1 A18 V2 Y6 Aselect * fron crn_configurations where provider = Oipedrave':CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE •* END) AS user_idSd.xt.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJOIN teams t 1.n<->1: on t.id = u.tean_idWHERE u.tean_id = 19 and sa.provider = 'pipednive':SELECT * FROM social accounts WHERE id = 1116:UPDATE social. accounts SET provider user token = *viu:AOIBAHS-L2TNK2yuuuaLoffzhWb9crUNKTok4F109cinXqp_6AE0hDhD0Va1nviCHEvnp)WHERE id = 1116:"orovider_user_token". "vlu:AOTBAH1-L2TNK2yuuuaLoifzh#b9crUNKTok4F109rinXop_6AE0h0h00Va1nvWCHEynpvSEAAAAf1B8Bqkchk#69a9BBи:"orovider refreshtoken". "5034113:19555731-87c1425848c813d82767ee975f6044d46b6b2bfc**"exotres":7989199select * Fron ern Field valuesselect * from con fields where tvoe = "nultcoickuisteSLECT * FRON con layouts WHERE uufd to bin(+7c327871-4625-4056-9a8f-44cSa849d65c') = uujd:SELECT * EROM con Sseldi values WHEDE con £lela 30 = 7912.Im value "3014 ny value ond3014my value two3014 ny valueThnes3014 ay value four3014 my value#iuem) Label Mam) sequence yay valuc onny value twony value threeny value fouray value fiveim is default yim) created. at8 2826-02-10 11:01:108 2926-92-10 11:01:188. 2826-82-10 11-81-188 2826-02-10 11:01:108 2026-02-10 11:01:16im updated. aty2026-02-10 11:01:162026-82-10 11:81:16WinhendeThttehhe2026-02-10 11:01:102026-82-10 11:01:16TO0%L7Thu 28 May 9:25:19TextRelayServiceTesteeendhrner hensemwiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail nailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10lb bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnant orectly via tinker to verity the header logic without disaatchine amvthinotioh.reading logic on a known message 1oSsvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthino (2a1CAdastivCSVyДus.0027/010 liTeg ensd...
|
NULL
|
7209865614927502235
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormViewCoocRurToolWindowFV faVsco.|s ~$ JY-20 PhpStormViewCoocRurToolWindowFV faVsco.|s ~$ JY-20915-fix-mis:Kemelonp© SyncMailbox.phpEinfection ison distTextRelayServiceTest.phpMENSTAmMAINTERNAL_WEBHOOK SETUP.mdjiminny_storagewulicancas maM Makefile# package-lock.jsonE phpstan.neon.distEphpstan-baseline.neon<>phounit.xml1% raw.salquery.salM:README.mdô sonar-proiect propertiesEtest.ovwo on teo Mractom-xmlis vetur.confialisM.WEBHOOK_FILTERING.IMPLEMENTAT> 1h Extemal Librariesv E Scratches and Consolesv M Database Consolesconsole iauDEALRSKS TEUDTEUEUTEUvm anuctden noehconsola timinowsoes roeAN fiiminovAlocalbostt2 HS.Jlocal jiminny@localhosttiminoutioeainden& zoho_dev jiminny@localhost)yewel#concalo ropontServicos+o₫v MDatabas,consoleyliminny@loch nostS:1s314mA HSLlocalcancaloN CTAGING# consoleTnastorPyyminny.onclass Field extends Modeluse RequiresUUIdUse cnunswoe constnwanichohsooublic const int LABEL MAXLENGTH = 255:oublic const sint DESCRIPTION MAXLENGTH = 191;public const string TYPE_HULIAPICKLIST = "nuLti-picklist"ENot vet supportedoub1ie const string TYPE PERCENTIpercentqubsic const string ipE PriKESTnuhite conet sranewpr wieeshnuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivoshpublic const string TYPE_PHONEnhile conet etaiinauivor10public const string TYPE DATEpublic const string TYPE TIMEpublic const string TYPE DATETIMEpublic const string TYPE UNSUPPORTED = *unsupported'=public const string OBJECT LEAGoublic const stoing OBJECT ACCOUNT7) Outputtit jiminny.crm field. valuesGi:wSrowsQMEA0wridy(m uuid UUID with tine-low and time-h_y: wcrn field id yO00 [CREDIT_CARD] HAHA CRAGARROGAR44801 6796ad28-7b4b-468a-9369-34aced141927hine accea.oscnec/chhoattanhariih44883 18db6888-48a2-4719-b76e-899d7f8abb24ALARZ ZZORAdA-ARI1-/RAS-079/-CCA7ZAАCANАMockeriit=custom.logaraveliosSF (iminny@localhost) xconedia Pere# console FulA console (STAGINGTwWLAV-24т248252253256257258=260E261=268TeAuto vDo jminny021 A1 A18 V2 Y6 Aselect * fron crn_configurations where provider = Oipedrave':CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE •* END) AS user_idSd.xt.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJOIN teams t 1.n<->1: on t.id = u.tean_idWHERE u.tean_id = 19 and sa.provider = 'pipednive':SELECT * FROM social accounts WHERE id = 1116:UPDATE social. accounts SET provider user token = *viu:AOIBAHS-L2TNK2yuuuaLoffzhWb9crUNKTok4F109cinXqp_6AE0hDhD0Va1nviCHEvnp)WHERE id = 1116:"orovider_user_token". "vlu:AOTBAH1-L2TNK2yuuuaLoifzh#b9crUNKTok4F109rinXop_6AE0h0h00Va1nvWCHEynpvSEAAAAf1B8Bqkchk#69a9BBи:"orovider refreshtoken". "5034113:19555731-87c1425848c813d82767ee975f6044d46b6b2bfc**"exotres":7989199select * Fron ern Field valuesselect * from con fields where tvoe = "nultcoickuisteSLECT * FRON con layouts WHERE uufd to bin(+7c327871-4625-4056-9a8f-44cSa849d65c') = uujd:SELECT * EROM con Sseldi values WHEDE con £lela 30 = 7912.Im value "3014 ny value ond3014my value two3014 ny valueThnes3014 ay value four3014 my value#iuem) Label Mam) sequence yay valuc onny value twony value threeny value fouray value fiveim is default yim) created. at8 2826-02-10 11:01:108 2926-92-10 11:01:188. 2826-82-10 11-81-188 2826-02-10 11:01:108 2026-02-10 11:01:16im updated. aty2026-02-10 11:01:162026-82-10 11:81:16WinhendeThttehhe2026-02-10 11:01:102026-82-10 11:01:16TO0%L7Thu 28 May 9:25:19TextRelayServiceTesteeendhrner hensemwiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail nailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.comaeu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10lb bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnant orectly via tinker to verity the header logic without disaatchine amvthinotioh.reading logic on a known message 1oSsvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthino (2a1CAdastivCSVyДus.0027/010 liTeg ensd...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79324
|
2784
|
22
|
2026-05-28T06:25:21.779729+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949521779_m1.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
SELECT * FROM crm_fields WHERE id = 3014;
SELECT * FROM crm_field_values WHERE crm_field_id = 3014;
Project
Project...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","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":"42","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":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Models\\Crm;\n\nuse Illuminate\\Database\\Eloquent\\Attributes\\Scope;\nuse Illuminate\\Database\\Eloquent\\Collection;\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\nuse Illuminate\\Database\\Eloquent\\Relations\\HasMany;\nuse Jiminny\\Component\\Eloquent\\Builder;\nuse Jiminny\\Models\\Ai\\CrmTemplateField;\nuse Jiminny\\Models\\Model;\nuse Jiminny\\Models\\Playbook;\nuse Jiminny\\Services\\Crm\\CrmObjects\\FieldReadonlyConstants;\nuse Jiminny\\Services\\Crm\\IntegrationApp\\DTO\\CrmFieldDefinitionsManager;\nuse Jiminny\\Traits\\Enums;\nuse Jiminny\\Traits\\RequiresUUID;\n\n/**\n * Jiminny\\Models\\Crm\\Field\n *\n * @property int $id\n * @property mixed|null $uuid\n * @property int $crm_configuration_id\n * @property string $crm_provider_id\n * @property string $label\n * @property string|null $description\n * @property string $type\n * @property int|null $length\n * @property string|null $default_value\n * @property string $object_type\n * @property bool $is_selectable\n * @property bool $is_mandatory\n * @property bool $is_filterable\n * @property bool $is_indexable\n * @property \\Illuminate\\Support\\Carbon|null $created_at\n * @property \\Illuminate\\Support\\Carbon|null $updated_at\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $configuration\n * @property-read \\Jiminny\\Models\\Crm\\Configuration $crm\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldData> $data\n * @property-read int|null $data_count\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\LayoutEntity> $entities\n * @property-read int|null $entities_count\n * @property-read string $id_string\n * @property-read Collection<int, \\Jiminny\\Models\\Crm\\FieldValue> $values\n * @property-read int|null $values_count\n *\n * @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)\n * @method static \\Database\\Factories\\Crm\\FieldFactory factory(...$parameters)\n * @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)\n * @method static Builder|Field indexable()\n * @method static Builder|Field newModelQuery()\n * @method static Builder|Field newQuery()\n * @method static Builder|Field query()\n * @method static Builder|Field tasks()\n * @method static Builder|Field uuid(string $uuid, bool $first = true)\n * @method static Builder|Field whereCreatedAt($value)\n * @method static Builder|Field whereCrmConfigurationId($value)\n * @method static Builder|Field whereCrmProviderId($value)\n * @method static Builder|Field whereDefaultValue($value)\n * @method static Builder|Field whereDescription($value)\n * @method static Builder|Field whereId($value)\n * @method static Builder|Field whereIsFilterable($value)\n * @method static Builder|Field whereIsIndexable($value)\n * @method static Builder|Field whereIsMandatory($value)\n * @method static Builder|Field whereIsSelectable($value)\n * @method static Builder|Field whereLabel($value)\n * @method static Builder|Field whereLength($value)\n * @method static Builder|Field whereObjectType($value)\n * @method static Builder|Field whereType($value)\n * @method static Builder|Field whereUpdatedAt($value)\n * @method static Builder|Field whereUuid($value)\n *\n * @mixin \\Eloquent\n */\nclass Field extends Model\n{\n use HasFactory;\n\n use RequiresUUID;\n use Enums;\n\n public const int NAME_MAX_LENGTH = 128;\n public const int LABEL_MAX_LENGTH = 255;\n public const int DESCRIPTION_MAX_LENGTH = 191;\n\n public const string TYPE_MULTIPICKLIST = 'multi-picklist';\n // Not yet supported\n public const string TYPE_PERCENT = 'percent';\n\n public const string TYPE_PICKLIST = 'picklist';\n public const string TYPE_NUMBER = 'number';\n public const string TYPE_CURRENCY = 'currency';\n public const string TYPE_BOOLEAN = 'boolean';\n public const string TYPE_TEXT = 'text';\n public const string TYPE_TEXTAREA = 'textarea';\n public const string TYPE_EMAIL = 'email';\n public const string TYPE_PHONE = 'phone';\n public const string TYPE_URL = 'url';\n public const string TYPE_DATE = 'date';\n public const string TYPE_TIME = 'time';\n public const string TYPE_DATETIME = 'datetime';\n public const string TYPE_UNSUPPORTED = 'unsupported';\n\n public const string OBJECT_LEAD = 'lead';\n public const string OBJECT_ACCOUNT = 'account';\n public const string OBJECT_CONTACT = 'contact';\n public const string OBJECT_OPPORTUNITY = 'opportunity';\n public const string OBJECT_TASK = 'task';\n public const string OBJECT_EVENT = 'event';\n public const string OBJECT_CALL = 'call';\n public const string OBJECT_MEETING = 'meeting';\n\n public const array BUSINESS_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'Type',\n Configuration::PROVIDER_HUBSPOT => 'dealtype',\n ];\n\n public const array PIPELINE_TYPE_FIELDS = [\n Configuration::PROVIDER_HUBSPOT => 'pipeline',\n ];\n\n public const array STAGE_TYPE_FIELDS = [\n Configuration::PROVIDER_SALESFORCE => 'StageName',\n Configuration::PROVIDER_HUBSPOT => 'dealstage',\n Configuration::PROVIDER_CLOSE => 'status_id',\n Configuration::PROVIDER_BULLHORN => 'status',\n Configuration::PROVIDER_PIPEDRIVE => 'stage_id',\n Configuration::PROVIDER_COPPER => 'pipeline_stage_id',\n ];\n\n public static $enumTypes = [\n self::TYPE_PICKLIST,\n self::TYPE_NUMBER,\n self::TYPE_CURRENCY,\n self::TYPE_BOOLEAN,\n self::TYPE_TEXT,\n self::TYPE_TEXTAREA,\n self::TYPE_EMAIL,\n self::TYPE_PHONE,\n self::TYPE_URL,\n self::TYPE_DATE,\n self::TYPE_TIME,\n self::TYPE_DATETIME,\n self::TYPE_UNSUPPORTED,\n ];\n\n public static $enumObjectTypes = [\n self::OBJECT_LEAD,\n self::OBJECT_ACCOUNT,\n self::OBJECT_CONTACT,\n self::OBJECT_OPPORTUNITY,\n self::OBJECT_TASK,\n self::OBJECT_EVENT,\n ];\n\n protected $table = 'crm_fields';\n\n protected $fillable = [\n 'crm_configuration_id',\n 'crm_provider_id',\n 'object_type',\n 'type',\n 'label',\n 'description',\n 'is_selectable',\n 'is_mandatory',\n 'length',\n 'default_value',\n 'is_indexable',\n 'is_filterable',\n 'is_readonly',\n ];\n\n protected $appends = [\n 'id_string',\n ];\n\n protected $hidden = [\n 'uuid',\n 'id',\n 'crm_configuration_id',\n ];\n\n protected function casts(): array\n {\n return [\n 'is_selectable' => 'boolean',\n 'is_mandatory' => 'boolean',\n 'is_indexable' => 'boolean',\n 'is_filterable' => 'boolean',\n ];\n }\n\n public function configuration(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n public function entities(): HasMany\n {\n return $this->hasMany(LayoutEntity::class, 'crm_field_id');\n }\n\n public function getEntities(): Collection\n {\n /** @var Collection<LayoutEntity> $entities */\n $entities = $this->getAttribute('entities');\n\n return $entities;\n }\n\n public function values(): HasMany\n {\n return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');\n }\n\n public function getLabel(): string\n {\n return $this->getAttribute('label');\n }\n\n public function getType(): string\n {\n return $this->getAttribute('type');\n }\n\n public function getObjectType(): string\n {\n /** @var string */\n return $this->getAttribute('object_type');\n }\n\n public function getCrmProviderId(): string\n {\n /** @var string */\n return $this->getAttribute('crm_provider_id');\n }\n\n public function getValues(): Collection\n {\n return $this->getAttribute('values');\n }\n\n public function isIndexable(): bool\n {\n return $this->getAttribute('is_indexable');\n }\n\n public function isFilterable(): bool\n {\n return $this->getAttribute('is_filterable');\n }\n\n public function getId(): int\n {\n /** @var int */\n return $this->getAttribute('id');\n }\n\n public function hasDescription(): bool\n {\n return $this->getAttribute('description') !== null;\n }\n\n public function getDescription(): ?string\n {\n return $this->getAttribute('description');\n }\n\n public function data()\n {\n return $this->hasMany(FieldData::class, 'crm_field_id');\n }\n\n public function crm(): BelongsTo\n {\n return $this->belongsTo(Configuration::class, 'crm_configuration_id');\n }\n\n #[Scope]\n protected function indexable($query)\n {\n return $query->where('is_indexable', 1);\n }\n\n #[Scope]\n protected function tasks($query)\n {\n return $query->where('object_type', self::OBJECT_TASK);\n }\n\n public function isBusinessType(): bool\n {\n return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isStageField(): bool\n {\n return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function isPipelineField(): bool\n {\n return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)\n && $this->getObjectType() === self::OBJECT_OPPORTUNITY;\n }\n\n public function getUuid(): string\n {\n return $this->getAttribute('id_string');\n }\n\n public function getCrmConfiguration(): Configuration\n {\n return $this->getAttribute('crm');\n }\n\n public function getCrmConfigurationId(): int\n {\n return $this->getAttribute('crm_configuration_id');\n }\n\n /**\n * Currently implemented only for Opportunity fields\n */\n public function isReadOnly(): bool\n {\n // The CRM Field metadata should always be first to be taken into consideration.\n if ($this->getIsReadonly()) {\n return true;\n }\n\n if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {\n return false;\n }\n\n if ($this->isPipelineField()) {\n return true;\n }\n\n if ($this->getType() === Field::TYPE_UNSUPPORTED) {\n return true;\n }\n\n if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {\n $fieldDefinitions = new CrmFieldDefinitionsManager();\n\n return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);\n }\n\n return false;\n }\n\n public function isPicklist(): bool\n {\n return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);\n }\n\n public function getLength(): ?int\n {\n return $this->getAttribute('length');\n }\n\n public function getDefaultValue(): ?string\n {\n return $this->getAttribute('default_value');\n }\n\n public function setIsReadonly(int $isReadonly): void\n {\n $this->setAttribute('is_readonly', $isReadonly);\n }\n\n public function getIsReadonly(): bool\n {\n return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;\n }\n\n public function getEntityName(): string\n {\n return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();\n }\n\n public function crmTemplateFields(): HasMany\n {\n return $this->hasMany(CrmTemplateField::class, 'crm_field_id');\n }\n\n public function playbooks(): HasMany\n {\n return $this->hasMany(Playbook::class, 'activity_field_id');\n }\n\n public function getPlaybooks(): Collection\n {\n return $this->getAttribute('playbooks');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"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":false,"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":true,"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":"21","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"18","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"2","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"6","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 a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;\nSELECT * FROM crm_fields WHERE id = 3014;\nSELECT * FROM crm_field_values WHERE crm_field_id = 3014;","depth":4,"on_screen":true,"value":"SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o\nJOIN activities a ON o.id = a.opportunity_id\nWHERE a.crm_configuration_id = 39\nAND a.actual_start_time > '2025-10-13'\nAND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM activities\nWHERE crm_configuration_id = 39 and user_id = 143\nand actual_start_time >= '2025-10-13'\nAND type IN ('conference', 'softphone-inbound', 'softphone-outbound')\n;\n\nSELECT * FROM opportunities WHERE account_id IN (178);\nselect * from activities where id IN (620137, 620187, 620188, 620189, 620230);\n\n# HS\nSELECT * FROM opportunities WHERE id IN (238);\nselect * from activities where id IN (477,2076);\n\nselect * from users;\n\nSELECT COUNT(*) FROM users;\nSELECT COUNT(*) FROM activities;\nSELECT COUNT(*) FROM opportunities;\n\nUPDATE activities\nSET\n actual_start_time = '2025-12-19 09:00:00',\n actual_end_time = '2025-12-19 10:30:00',\n scheduled_start_time = '2025-12-19 09:00:00',\n scheduled_end_time = '2025-12-19 10:30:00'\nWHERE id IN (407509,407375);\n\nselect * from partners;\n\nSELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id\nFROM activities\nWHERE user_id = 143\nAND actual_start_time >= '2025-10-13 00:00:00'\nAND actual_start_time <= '2026-01-13 23:59:59'\nORDER BY actual_start_time DESC;\n\nSELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;\nSELECT * FROM crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;\n# lead_id\n# account_id 177\n# contact_id 3969\n# opportunity_id\n# stage_id 203\n\nSELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;\n\nSELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'\nAND user_id = 143 and actual_start_time >= '2025-10-13';\n\nSELECT * FROM activities a\n# JOIN opportunities o ON a.opportunity_id = o.id\nWHERE a.crm_configuration_id = 39 AND a.type = 'conference'\nand status = 'completed' and recording_state = 'recorded'\nand a.actual_start_time >= '2025-10-13'\nAND a.user_id = 143\n;\n\nselect * from leads\nwhere crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707\n\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);\nSELECT * FROM activities WHERE id IN (356013,616188,616202,616310);\nSELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198\nSELECT * FROM activities WHERE id IN (356001, 356008); # contacts:\n\nSELECT * FROM opportunities WHERE id IN (1707);\nSELECT * FROM stages where id IN (204, 198);\nSELECT * FROM opportunities WHERE account_id IN (178);\nSELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';\nSELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal\n\nSELECT * FROM activities where crm_configuration_id = 39\nAND opportunity_id IS NULL\nAND is_internal = false\nand status = 'completed' and recording_state = 'recorded'\nAND actual_start_time >= '2025-10-13'\nAND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)\n# AND lead_id IN (112, 109)\n;\n\nSELECT * FROM crm_profiles WHERE user_id = 143;\n\nselect * from inboxes; # 212\nselect * from users where id = 143; # 143\nselect * from inbox_email_batches where inbox_id = 212\nand updated_at >= '2026-01-28 00:00:00' order by id desc;\nselect * from inbox_emails where inbox_id = 212\nand batch_id = 95885 order by id desc;\nselect * from email_messages where origin_user_id = 143;\nselect * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';\nselect * from participants where activity_id = 620247;\n\nselect * from crm_profiles where user_id = 143;\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001\nselect * from transcription where activity_id = 356001; # 6943\nselect * from ai_prompts where transcription_id = 6943;\nSELECT * FROM activity_summary_logs where activity_id = 356001;\n\nSELECT * FROM social_accounts WHERE sociable_id = 143;\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;\n# 422515 softphone tr. 8100\n\nSELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;\n# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS\n\nselect * from ai_prompts where transcription_id IN (8100, 7670);\nselect * from activity_summary_logs where activity_id = 407509;\n\nselect * from sidekick_settings;\nselect * from default_activity_types;\n\nSELECT * FROM contacts WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\nSELECT * FROM leads WHERE crm_configuration_id = 39 and email = 'm.kogoj@gmx.at';\n\nSELECT * FROM activity_searches where user_id = 143;\nSELECT * FROM groups where team_id = 1;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1; # 1150 - 7e75f8025c22\nselect id, name, group_id, status, deleted_at, email\nfrom users where team_id = 1 order by group_id desc ;\n\nselect * from activity_searches where id in (1977, 1978, 1979);\nselect * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);\nselect * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277\nselect * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879\n\nINSERT INTO `activity_search_filters`\n(`activity_search_id`, `filter`, `value`) VALUES\n(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),\n(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')\n;\n\nselect * from crm_configurations where id = 39;\n\n\nselect sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id\nwhere u.team_id = 1;\nSELECT * FROM social_accounts WHERE sociable_id = 1635;\nSELECT * FROM users WHERE id = 1635;\n\nselect * from teams where id = 1;\nselect * from users where team_id = 1;\nselect * from team_features where team_id = 1;\nselect * from features;\n\nSELECT * FROM activity_searches where id = 1982; # 1981\nSELECT * FROM activity_search_filters WHERE activity_search_id = 1982;\n\nSELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;\nSELECT * FROM groups WHERE id = 1439;\nSELECT * FROM users WHERE group_id = 1439;\n\nselect * from permissions; # 158\nselect * from roles;\nselect * from permission_role;\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 28;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 179;\nselect * from playbook_categories where id = 1391;\nselect * from users where id = 143;\nselect * from crm_profiles where user_id = 143;\nselect * from activities where crm_configuration_id = 39 and type = 'conference'\nand crm_provider_id IS NOT NULL ORDER by id desc;\nselect * from activities where id = 422003; # 00UO400000pB6fpMAC\n\nSELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type\nFROM automated_report_results ar\nJOIN automated_reports a ON a.id = ar.report_id\nWHERE a.type = 'ask_jiminny'\nLIMIT 10;\n\nSELECT * FROM automated_reports where id = 71;\nSELECT * FROM automated_report_results where report_id = 71;\nUPDATE automated_reports set playbook_categories = NULL where id = 68;\nSELECT * FROM automated_report_results where id = 275;\n\nSELECT * FROM automated_reports order by id desc;\nSELECT * FROM automated_report_results order by id desc;\nselect * from activity_searches where user_id = 143;\nselect * from ask_anything_prompts;\n\nSELECT `automated_report_results`.* FROM `automated_report_results`\nINNER JOIN `automated_reports`\n ON `automated_report_results`.`report_id` = `automated_reports`.`id`\nWHERE 1=1\n AND `automated_report_results`.`generated_at` IS NOT NULL\n# AND `automated_report_results`.`sent_at` IS NOT NULL\n AND `automated_reports`.`team_id` = 1\n AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$.\"users\"')\n;\n\nSELECT * FROM automated_reports where id = 67;\nSELECT * FROM automated_reports where id = 42;\nSELECT * FROM users WHERE id = 143; # group 28\n\nselect * from teams where id = 3143;\nselect * from crm_configurations where id = 500;\nselect * from users where name = 'Integration Account'; # 1695\nSELECT * FROM social_accounts WHERE sociable_id = 1695;\n\nselect * from activities where crm_configuration_id = 39\nand recording_state = 'recorded' and duration > 60\nand status = 'completed' and actual_start_time >= '2025-12-01';\n\nSELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;\n\nselect * from leads;\n\nSELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003\nSELECT * FROM activities WHERE id IN (16,422003);\nSELECT * FROM activities where status = 'failed';\n\nSELECT * FROM tracks WHERE activity_id = 422003;\n\nSELECT\n a.*\nFROM activities a\nJOIN users u ON a.user_id = u.id\nWHERE\n a.status = 'completed'\n AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid\n AND a.deleted_at IS NULL\n AND EXISTS (\n SELECT 1 FROM tracks t\n WHERE t.activity_id = a.id\n AND t.type IN ('audio', 'video')\n )\nORDER BY a.actual_start_time DESC\nLIMIT 25;\n\nselect * from teams where id = 19;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 19 and sa.provider = 'pipedrive';\n\nSELECT * FROM social_accounts WHERE id = 1116;\n\nUPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',\nprovider_refresh_token = '5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc',\nexpires = 1779091997,\nstate = 'connected'\nWHERE id = 1116;\n\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n\nselect * from crm_field_values;\n\nselect * from crm_fields where type = 'multi-picklist';\nSELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;\nSELECT * FROM crm_fields WHERE id = 3014;\nSELECT * FROM crm_field_values WHERE crm_field_id = 3014;","role_description":"text entry area","is_enabled":true,"is_focused":true,"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}]...
|
-6353775816605307290
|
6685203931320227421
|
typing_pause
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
42
4
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Models\Crm;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Jiminny\Component\Eloquent\Builder;
use Jiminny\Models\Ai\CrmTemplateField;
use Jiminny\Models\Model;
use Jiminny\Models\Playbook;
use Jiminny\Services\Crm\CrmObjects\FieldReadonlyConstants;
use Jiminny\Services\Crm\IntegrationApp\DTO\CrmFieldDefinitionsManager;
use Jiminny\Traits\Enums;
use Jiminny\Traits\RequiresUUID;
/**
* Jiminny\Models\Crm\Field
*
* @property int $id
* @property mixed|null $uuid
* @property int $crm_configuration_id
* @property string $crm_provider_id
* @property string $label
* @property string|null $description
* @property string $type
* @property int|null $length
* @property string|null $default_value
* @property string $object_type
* @property bool $is_selectable
* @property bool $is_mandatory
* @property bool $is_filterable
* @property bool $is_indexable
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Jiminny\Models\Crm\Configuration $configuration
* @property-read \Jiminny\Models\Crm\Configuration $crm
* @property-read Collection<int, \Jiminny\Models\Crm\FieldData> $data
* @property-read int|null $data_count
* @property-read Collection<int, \Jiminny\Models\Crm\LayoutEntity> $entities
* @property-read int|null $entities_count
* @property-read string $id_string
* @property-read Collection<int, \Jiminny\Models\Crm\FieldValue> $values
* @property-read int|null $values_count
*
* @method static Builder|Field chunkByIdDesc($count, callable $callback, $column = null, $alias = null)
* @method static \Database\Factories\Crm\FieldFactory factory(...$parameters)
* @method static Builder|Field idOrUuId($idOrUuid, bool $first = true)
* @method static Builder|Field indexable()
* @method static Builder|Field newModelQuery()
* @method static Builder|Field newQuery()
* @method static Builder|Field query()
* @method static Builder|Field tasks()
* @method static Builder|Field uuid(string $uuid, bool $first = true)
* @method static Builder|Field whereCreatedAt($value)
* @method static Builder|Field whereCrmConfigurationId($value)
* @method static Builder|Field whereCrmProviderId($value)
* @method static Builder|Field whereDefaultValue($value)
* @method static Builder|Field whereDescription($value)
* @method static Builder|Field whereId($value)
* @method static Builder|Field whereIsFilterable($value)
* @method static Builder|Field whereIsIndexable($value)
* @method static Builder|Field whereIsMandatory($value)
* @method static Builder|Field whereIsSelectable($value)
* @method static Builder|Field whereLabel($value)
* @method static Builder|Field whereLength($value)
* @method static Builder|Field whereObjectType($value)
* @method static Builder|Field whereType($value)
* @method static Builder|Field whereUpdatedAt($value)
* @method static Builder|Field whereUuid($value)
*
* @mixin \Eloquent
*/
class Field extends Model
{
use HasFactory;
use RequiresUUID;
use Enums;
public const int NAME_MAX_LENGTH = 128;
public const int LABEL_MAX_LENGTH = 255;
public const int DESCRIPTION_MAX_LENGTH = 191;
public const string TYPE_MULTIPICKLIST = 'multi-picklist';
// Not yet supported
public const string TYPE_PERCENT = 'percent';
public const string TYPE_PICKLIST = 'picklist';
public const string TYPE_NUMBER = 'number';
public const string TYPE_CURRENCY = 'currency';
public const string TYPE_BOOLEAN = 'boolean';
public const string TYPE_TEXT = 'text';
public const string TYPE_TEXTAREA = 'textarea';
public const string TYPE_EMAIL = 'email';
public const string TYPE_PHONE = 'phone';
public const string TYPE_URL = 'url';
public const string TYPE_DATE = 'date';
public const string TYPE_TIME = 'time';
public const string TYPE_DATETIME = 'datetime';
public const string TYPE_UNSUPPORTED = 'unsupported';
public const string OBJECT_LEAD = 'lead';
public const string OBJECT_ACCOUNT = 'account';
public const string OBJECT_CONTACT = 'contact';
public const string OBJECT_OPPORTUNITY = 'opportunity';
public const string OBJECT_TASK = 'task';
public const string OBJECT_EVENT = 'event';
public const string OBJECT_CALL = 'call';
public const string OBJECT_MEETING = 'meeting';
public const array BUSINESS_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'Type',
Configuration::PROVIDER_HUBSPOT => 'dealtype',
];
public const array PIPELINE_TYPE_FIELDS = [
Configuration::PROVIDER_HUBSPOT => 'pipeline',
];
public const array STAGE_TYPE_FIELDS = [
Configuration::PROVIDER_SALESFORCE => 'StageName',
Configuration::PROVIDER_HUBSPOT => 'dealstage',
Configuration::PROVIDER_CLOSE => 'status_id',
Configuration::PROVIDER_BULLHORN => 'status',
Configuration::PROVIDER_PIPEDRIVE => 'stage_id',
Configuration::PROVIDER_COPPER => 'pipeline_stage_id',
];
public static $enumTypes = [
self::TYPE_PICKLIST,
self::TYPE_NUMBER,
self::TYPE_CURRENCY,
self::TYPE_BOOLEAN,
self::TYPE_TEXT,
self::TYPE_TEXTAREA,
self::TYPE_EMAIL,
self::TYPE_PHONE,
self::TYPE_URL,
self::TYPE_DATE,
self::TYPE_TIME,
self::TYPE_DATETIME,
self::TYPE_UNSUPPORTED,
];
public static $enumObjectTypes = [
self::OBJECT_LEAD,
self::OBJECT_ACCOUNT,
self::OBJECT_CONTACT,
self::OBJECT_OPPORTUNITY,
self::OBJECT_TASK,
self::OBJECT_EVENT,
];
protected $table = 'crm_fields';
protected $fillable = [
'crm_configuration_id',
'crm_provider_id',
'object_type',
'type',
'label',
'description',
'is_selectable',
'is_mandatory',
'length',
'default_value',
'is_indexable',
'is_filterable',
'is_readonly',
];
protected $appends = [
'id_string',
];
protected $hidden = [
'uuid',
'id',
'crm_configuration_id',
];
protected function casts(): array
{
return [
'is_selectable' => 'boolean',
'is_mandatory' => 'boolean',
'is_indexable' => 'boolean',
'is_filterable' => 'boolean',
];
}
public function configuration(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
public function entities(): HasMany
{
return $this->hasMany(LayoutEntity::class, 'crm_field_id');
}
public function getEntities(): Collection
{
/** @var Collection<LayoutEntity> $entities */
$entities = $this->getAttribute('entities');
return $entities;
}
public function values(): HasMany
{
return $this->hasMany(FieldValue::class, 'crm_field_id')->orderBy('sequence');
}
public function getLabel(): string
{
return $this->getAttribute('label');
}
public function getType(): string
{
return $this->getAttribute('type');
}
public function getObjectType(): string
{
/** @var string */
return $this->getAttribute('object_type');
}
public function getCrmProviderId(): string
{
/** @var string */
return $this->getAttribute('crm_provider_id');
}
public function getValues(): Collection
{
return $this->getAttribute('values');
}
public function isIndexable(): bool
{
return $this->getAttribute('is_indexable');
}
public function isFilterable(): bool
{
return $this->getAttribute('is_filterable');
}
public function getId(): int
{
/** @var int */
return $this->getAttribute('id');
}
public function hasDescription(): bool
{
return $this->getAttribute('description') !== null;
}
public function getDescription(): ?string
{
return $this->getAttribute('description');
}
public function data()
{
return $this->hasMany(FieldData::class, 'crm_field_id');
}
public function crm(): BelongsTo
{
return $this->belongsTo(Configuration::class, 'crm_configuration_id');
}
#[Scope]
protected function indexable($query)
{
return $query->where('is_indexable', 1);
}
#[Scope]
protected function tasks($query)
{
return $query->where('object_type', self::OBJECT_TASK);
}
public function isBusinessType(): bool
{
return in_array($this->getCrmProviderId(), self::BUSINESS_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isStageField(): bool
{
return in_array($this->getCrmProviderId(), self::STAGE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function isPipelineField(): bool
{
return in_array($this->getCrmProviderId(), self::PIPELINE_TYPE_FIELDS)
&& $this->getObjectType() === self::OBJECT_OPPORTUNITY;
}
public function getUuid(): string
{
return $this->getAttribute('id_string');
}
public function getCrmConfiguration(): Configuration
{
return $this->getAttribute('crm');
}
public function getCrmConfigurationId(): int
{
return $this->getAttribute('crm_configuration_id');
}
/**
* Currently implemented only for Opportunity fields
*/
public function isReadOnly(): bool
{
// The CRM Field metadata should always be first to be taken into consideration.
if ($this->getIsReadonly()) {
return true;
}
if ($this->getObjectType() !== self::OBJECT_OPPORTUNITY) {
return false;
}
if ($this->isPipelineField()) {
return true;
}
if ($this->getType() === Field::TYPE_UNSUPPORTED) {
return true;
}
if ($this->getCrmConfiguration()->getProviderName() === Configuration::PROVIDER_INTEGRATION_APP) {
$fieldDefinitions = new CrmFieldDefinitionsManager();
return $fieldDefinitions->isReadOnly($this->getCrmProviderId(), self::OBJECT_OPPORTUNITY);
}
return false;
}
public function isPicklist(): bool
{
return in_array($this->getType(), [self::TYPE_PICKLIST, self::TYPE_MULTIPICKLIST]);
}
public function getLength(): ?int
{
return $this->getAttribute('length');
}
public function getDefaultValue(): ?string
{
return $this->getAttribute('default_value');
}
public function setIsReadonly(int $isReadonly): void
{
$this->setAttribute('is_readonly', $isReadonly);
}
public function getIsReadonly(): bool
{
return $this->getAttribute('is_readonly') !== FieldReadonlyConstants::FIELD_IS_UPDATABLE;
}
public function getEntityName(): string
{
return ucfirst($this->getObjectType()) . '.' . $this->getCrmProviderId();
}
public function crmTemplateFields(): HasMany
{
return $this->hasMany(CrmTemplateField::class, 'crm_field_id');
}
public function playbooks(): HasMany
{
return $this->hasMany(Playbook::class, 'activity_field_id');
}
public function getPlaybooks(): Collection
{
return $this->getAttribute('playbooks');
}
}
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
21
1
18
2
6
Previous Highlighted Error
Next Highlighted Error
SELECT a.id, a.uuid, a.actual_start_time, o.id, o.uuid FROM opportunities o
JOIN activities a ON o.id = a.opportunity_id
WHERE a.crm_configuration_id = 39
AND a.actual_start_time > '2025-10-13'
AND a.type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM activities
WHERE crm_configuration_id = 39 and user_id = 143
and actual_start_time >= '2025-10-13'
AND type IN ('conference', 'softphone-inbound', 'softphone-outbound')
;
SELECT * FROM opportunities WHERE account_id IN (178);
select * from activities where id IN (620137, 620187, 620188, 620189, 620230);
# HS
SELECT * FROM opportunities WHERE id IN (238);
select * from activities where id IN (477,2076);
select * from users;
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM activities;
SELECT COUNT(*) FROM opportunities;
UPDATE activities
SET
actual_start_time = '2025-12-19 09:00:00',
actual_end_time = '2025-12-19 10:30:00',
scheduled_start_time = '2025-12-19 09:00:00',
scheduled_end_time = '2025-12-19 10:30:00'
WHERE id IN (407509,407375);
select * from partners;
SELECT id, uuid, type, actual_start_time, user_id, crm_configuration_id
FROM activities
WHERE user_id = 143
AND actual_start_time >= '2025-10-13 00:00:00'
AND actual_start_time <= '2026-01-13 23:59:59'
ORDER BY actual_start_time DESC;
SELECT * FROM activities WHERE uuid_to_bin('78eda160-3086-435f-88a5-bb0c71b6008d') = uuid;
SELECT * FROM crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 282;
# lead_id
# account_id 177
# contact_id 3969
# opportunity_id
# stage_id 203
SELECT * FROM opportunities WHERE opportunities.crm_configuration_id = id = 282;
SELECT * FROM activities where crm_configuration_id = 39 AND type = 'conference'
AND user_id = 143 and actual_start_time >= '2025-10-13';
SELECT * FROM activities a
# JOIN opportunities o ON a.opportunity_id = o.id
WHERE a.crm_configuration_id = 39 AND a.type = 'conference'
and status = 'completed' and recording_state = 'recorded'
and a.actual_start_time >= '2025-10-13'
AND a.user_id = 143
;
select * from leads
where crm_configuration_id = 39; # 112 -> ac. 178, 109 => op. 1707
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310,407509,407375,356001,356008);
SELECT * FROM activities WHERE id IN (356013,616188,616202,616310);
SELECT * FROM activities WHERE id IN (407509,407375); # leads: 112, 109 | status - 198
SELECT * FROM activities WHERE id IN (356001, 356008); # contacts:
SELECT * FROM opportunities WHERE id IN (1707);
SELECT * FROM stages where id IN (204, 198);
SELECT * FROM opportunities WHERE account_id IN (178);
SELECT * FROM opportunities WHERE crm_configuration_id = 39 AND created_at > '2025-01-01';
SELECT * FROM contacts WHERE account_id IN (178); # 4118 Musaibe, 4448 Ceco Personal
SELECT * FROM activities where crm_configuration_id = 39
AND opportunity_id IS NULL
AND is_internal = false
and status = 'completed' and recording_state = 'recorded'
AND actual_start_time >= '2025-10-13'
AND (lead_id IS NOT NULL OR contact_id IS NOT NULL OR account_id IS NOT NULL)
# AND lead_id IN (112, 109)
;
SELECT * FROM crm_profiles WHERE user_id = 143;
select * from inboxes; # 212
select * from users where id = 143; # 143
select * from inbox_email_batches where inbox_id = 212
and updated_at >= '2026-01-28 00:00:00' order by id desc;
select * from inbox_emails where inbox_id = 212
and batch_id = 95885 order by id desc;
select * from email_messages where origin_user_id = 143;
select * from activities where user_id = 143 and updated_at >= '2026-01-28 00:00:00';
select * from participants where activity_id = 620247;
select * from crm_profiles where user_id = 143;
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid; # 356001
select * from transcription where activity_id = 356001; # 6943
select * from ai_prompts where transcription_id = 6943;
SELECT * FROM activity_summary_logs where activity_id = 356001;
SELECT * FROM social_accounts WHERE sociable_id = 143;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('0164a4fb-cb95-454e-9edd-4d804e4999bd') = uuid;
# 422515 softphone tr. 8100
SELECT * FROM activities WHERE uuid_to_bin('7520add8-8d87-41a5-98e5-fc4edf96f21e') = uuid;
# 407509 conference tr. 7670 crmId: 00UD1000002J9aTMAS
select * from ai_prompts where transcription_id IN (8100, 7670);
select * from activity_summary_logs where activity_id = 407509;
select * from sidekick_settings;
select * from default_activity_types;
SELECT * FROM contacts WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM leads WHERE crm_configuration_id = 39 and email = '[EMAIL]';
SELECT * FROM activity_searches where user_id = 143;
SELECT * FROM groups where team_id = 1;
select * from teams where id = 1;
select * from groups where team_id = 1; # 1150 - 7e75f8025c22
select id, name, group_id, status, deleted_at, email
from users where team_id = 1 order by group_id desc ;
select * from activity_searches where id in (1977, 1978, 1979);
select * from activity_search_filters where activity_search_id IN (1977, 1978, 1979);
select * from activity_search_filters where filter = 'group_id' and value = '443f26b8-8512-437e-a9f9-7e75f8025c22'; # 10268, 10272, 10277
select * from nudges where activity_search_id IN (1977, 1978, 1979); # 877, 878, 879
INSERT INTO `activity_search_filters`
(`activity_search_id`, `filter`, `value`) VALUES
(1977, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1978, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22'),
(1979, 'group_id', '443f26b8-8512-437e-a9f9-7e75f8025c22')
;
select * from crm_configurations where id = 39;
select sa.* from users u JOIN social_accounts sa on u.id = sa.sociable_id
where u.team_id = 1;
SELECT * FROM social_accounts WHERE sociable_id = 1635;
SELECT * FROM users WHERE id = 1635;
select * from teams where id = 1;
select * from users where team_id = 1;
select * from team_features where team_id = 1;
select * from features;
SELECT * FROM activity_searches where id = 1982; # 1981
SELECT * FROM activity_search_filters WHERE activity_search_id = 1982;
SELECT * FROM activities WHERE uuid_to_bin('e916569b-086c-4bd1-94d7-5e3802c27ccf') = uuid;
SELECT * FROM groups WHERE id = 1439;
SELECT * FROM users WHERE group_id = 1439;
select * from permissions; # 158
select * from roles;
select * from permission_role;
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 28;
select * from playbooks where team_id = 1;
select * from playbooks where id = 179;
select * from playbook_categories where id = 1391;
select * from users where id = 143;
select * from crm_profiles where user_id = 143;
select * from activities where crm_configuration_id = 39 and type = 'conference'
and crm_provider_id IS NOT NULL ORDER by id desc;
select * from activities where id = 422003; # 00UO400000pB6fpMAC
SELECT ar.id, ar.uuid, ar.media_type, ar.status, a.type
FROM automated_report_results ar
JOIN automated_reports a ON a.id = ar.report_id
WHERE a.type = 'ask_jiminny'
LIMIT 10;
SELECT * FROM automated_reports where id = 71;
SELECT * FROM automated_report_results where report_id = 71;
UPDATE automated_reports set playbook_categories = NULL where id = 68;
SELECT * FROM automated_report_results where id = 275;
SELECT * FROM automated_reports order by id desc;
SELECT * FROM automated_report_results order by id desc;
select * from activity_searches where user_id = 143;
select * from ask_anything_prompts;
SELECT `automated_report_results`.* FROM `automated_report_results`
INNER JOIN `automated_reports`
ON `automated_report_results`.`report_id` = `automated_reports`.`id`
WHERE 1=1
AND `automated_report_results`.`generated_at` IS NOT NULL
# AND `automated_report_results`.`sent_at` IS NOT NULL
AND `automated_reports`.`team_id` = 1
AND JSON_CONTAINS(`automated_reports`.`recipients`, 143, '$."users"')
;
SELECT * FROM automated_reports where id = 67;
SELECT * FROM automated_reports where id = 42;
SELECT * FROM users WHERE id = 143; # group 28
select * from teams where id = 3143;
select * from crm_configurations where id = 500;
select * from users where name = 'Integration Account'; # 1695
SELECT * FROM social_accounts WHERE sociable_id = 1695;
select * from activities where crm_configuration_id = 39
and recording_state = 'recorded' and duration > 60
and status = 'completed' and actual_start_time >= '2025-12-01';
SELECT * FROM activities WHERE uuid_to_bin('458cf915-b914-4000-b083-5687b32b2956') = uuid;
select * from leads;
SELECT * FROM activities WHERE uuid_to_bin('f43cf158-e60d-46e5-92f8-c4e0594a3219') = uuid; # 422003
SELECT * FROM activities WHERE id IN (16,422003);
SELECT * FROM activities where status = 'failed';
SELECT * FROM tracks WHERE activity_id = 422003;
SELECT
a.*
FROM activities a
JOIN users u ON a.user_id = u.id
WHERE
a.status = 'completed'
AND uuid_to_bin('641f1acb-16b8-42d1-8726-df52979dad0e') = u.uuid
AND a.deleted_at IS NULL
AND EXISTS (
SELECT 1 FROM tracks t
WHERE t.activity_id = a.id
AND t.type IN ('audio', 'video')
)
ORDER BY a.actual_start_time DESC
LIMIT 25;
select * from teams where id = 19;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 19 and sa.provider = 'pipedrive';
SELECT * FROM social_accounts WHERE id = 1116;
UPDATE social_accounts SET provider_user_token = 'v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA',
provider_refresh_token = '5034113:[TELEGRAM_TOKEN]b2bfc',
expires = 1779091997,
state = 'connected'
WHERE id = 1116;
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
select * from crm_field_values;
select * from crm_fields where type = 'multi-picklist';
SELECT * FROM crm_layouts WHERE uuid_to_bin('7c327871-fc25-4c56-9a0f-44c5a849d65c') = uuid;
SELECT * FROM crm_fields WHERE id = 3014;
SELECT * FROM crm_field_values WHERE crm_field_id = 3014;
Project
Project...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
79325
|
2785
|
14
|
2026-05-28T06:25:22.201680+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779949522201_m2.jpg...
|
PhpStorm
|
faVsco.js – SF [jiminny@localhost]
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere...
|
[{"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-20915-fix-missing-header-text-relay, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09740692,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20915-fix-missing-header-text-relay","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.8374335,"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":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"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 'TextRelayServiceTest'","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 'TextRelayServiceTest'","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}]...
|
6445247769588009110
|
-6618793407836651056
|
typing_pause
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20915-fix-missing-head Project: faVsco.js, menu
JY-20915-fix-missing-header-text-relay, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
PhpStormViewCoocRurToolWindowFV faVsco.s ~$ JY-20915-fix-missing-header-text-relaKeroaioh.© SyncMailbox.phpEinfection ison distTextRelayServiceTest.phpphp fiminny.phgclass Field extends ModelMAINTERNAL_WEBHOOK SETUP.mdjiminny_storagewulicancas mause RequiresUUIduse EnunsM Makefile# package-lock.jsonE phpstan.neon.distEphpstan-baseline.neon<>phounit.xmlT% raw.sal.query.soM4 README.mdlô sonar-proiect propertiesEtest.ov<> Untitied Diagram.xmlis vetur.confialisM.WEBHOOK_FILTERING.IMPLEMENTAT> h Extemal Librariesv Eg Scratches and Consolesv M Database Consoleswoe constnwanichohsooublic const int LABEL MAXLENGTH = 255:oublic const sint DESCRIPTION MAXLENGTH = 191;public const string TYPE_HULIAPICKLIST = "nuLti-picklist"ENot vet supportedqub dic const string TYPE PERLENpercentqub sic const string tpE PriKeisTconsole iauDEALRSKS TEUDTEUEUTEUvm anuchdes nochconsola timinowtoes oeAN fiiminovAlocalbostt999909nuhite conet sranewpr wieeshnuhile conet etasneiVprtisyenpublic const string TYPE_TEXTAREAnhile conet etainoivosh2 HS.Jlocal jiminny@localhosttiminoutioeaindenpublic const string TYPE DATEpublic const string TYPE TIMEpublic const string TYPE DATETIMEpublic const string TYPE UNSUPPORTED = *unsupported'=& zoho_dev fiminny@localhostV A PRODpublic const string OBJECT LEAGoublic const stoing OBJECT ACCOUNT"account"#concalo ropontServicos+o₫7) Outputtil jiminny.crm.Jayoutsv MDatabas,of04TeAudswconsoleRid Yie. cre configuration idyliminny@loch nostA HSLlocalcancaloN CTAGING# consoleTnastorTmockarconedia PereA console (EU)A console (STAGING)Aa24A LD8000select * fron crn_configurations where provider = 'pipedoive':SELEC)Eassa.*,t.ouner_id FROM social_accounts saJOIN users u on u.id = sa.sociable_idJIOTM tasee +1.ncos1:on t 3d = mtean 6aWHERE U.tean_id = 19 and sa.provider = 'pipedoive":SELECT * FROM social accounts WHERE id = 1116:Do jminny021 A1 A18 V2 V6 AUPDATE social. accounts SET provider user token = *viu:AOIBAHS-L2TNK2yuuuaLoffzhWb9crUNKTok4F109cinXqp_6AE0hDhD0Va1nviCHEvnp)E 262=268Em"orovider_user_token". "vlu:AOTBAH1-L2TNK2yuuuaLoifzh#b9crUNKTok4F109rinXop_6AE0h0h00Va1nvWCHEynpvSEAAAAf1B8Bqkchk#69a9BBи:"orovider refreshtoken": "5034113:19555731-87c1425848c813d82767ee975f6044d46b6b2bfc*select * from eon fields where tvoe e "nultcosckist'SELECT * FROM chn layouts WHERE uufd to bin(+7c327871-4625-4056-9a8f-4LcSa849d65c') = uujdRSELECT * FROM Crn_field_Values WHERE cra_field_id = 3014;TQMAA®type Ymoane "00%LXThu 28 May 9:25:21TextRelayServiceTesteeendhrner hensewiet+0.can I test it locally first. if I place env from stagingYes. The service relies on a tew thinas vou'd need in olace1. Credentials file The constructor expects storage/text-relay.ison (a Google service account JSON key file)Gmbtrom sthaind and oince it there2. .env values to copy from stagingGOOGLE TEXTUSERECOOGLE TEXTI HASTGOOGLE TEXT RELAY TOPIC:DEPLOY REGION:the cnail mailbox address# e.g. txt.jiminny.com or txt.staging.jiminny.com# the Pub/Sub topic nam# eu or us3. Run the svnc manualiv vin tinker tinside docker 1ae 10lb bashaegdocker exec -it docker_lamp_1 php artisan tinkeapp(\Jiminny\Services\Ma1l\TextRelayService::class)-sync():Caveat: The service reads from Gmail history and e spatches lobs to the queuc. lt you don't want it to actualnsend SMS, make sure QUEUE_CONNECTICN»sync is not set (or use a test queue), or just call isForCurrentEnvironnant orectly via tinker to verity the header logic without disaatchine amvthinotioh.Ssvc = new class extends \Jiminny\Services\Mail\TextRelayService & public function _construct(sow:Service=ssvc-soctServicelcontiatainny.ooogle textuser'Ask anuthino (2a1§ AdaptiveCSVyzE..00NV M Aaur Tosme272d6 lTeeensd...
|
79323
|
NULL
|
NULL
|
NULL
|