<?php

namespace App\Services;

use App\Core\Database;

class CommandCenterService
{

public static function actions(): array
{

$db=
Database::getInstance();

return

$db
->query("

SELECT

action_key,

action_title,

action_icon,

action_endpoint,

action_group

FROM conference_action_registry

WHERE is_enabled=1

ORDER BY action_group,
id

")

->fetchAll()

??

[];

}

public static function log(
int $conferenceId,
string $action,
int $userId
): void
{

$db=
Database::getInstance();

$db
->prepare("

INSERT INTO
conference_action_history(

conference_id,

action_key,

action_status,

executed_by

)

VALUES(

?,

?,

'started',

?

)

")

->execute([

$conferenceId,

$action,

$userId

]);

}

}
