[VoiceCallHistory]

- implemented VoiceCallHistoryJob for running the jobs
- implement /VoiceCallHistory for displaying, importing the Voice Call History
- added date-range-picker to tt-table (still todo)
This commit is contained in:
Luca Haid
2024-04-10 15:17:02 +02:00
parent 9d5be184a2
commit b42409874b
10 changed files with 651 additions and 3 deletions
@@ -0,0 +1,42 @@
<?php /** @noinspection ALL */
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddVoiceCallHistory extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
//VoiceCallHistory Table
$voiceCallHistoryTable = $this->table("VoiceCallHistory", ["signed" => true]);
$voiceCallHistoryTable->addColumn("id", "integer", ["identity" => true]);
$voiceCallHistoryTable->addColumn("uid", "string", ["null" => false, "limit" => 255]);
$voiceCallHistoryTable->addColumn("voice_account", "string", ["null" => false, "limit" => 255]);
$voiceCallHistoryTable->addColumn("start", "datetime", ["null" => false]);
$voiceCallHistoryTable->addColumn("source", "string", ["null" => true, "limit" => 255]);
$voiceCallHistoryTable->addColumn("destination", "string", ["null" => true, "limit" => 255]);
$voiceCallHistoryTable->addColumn("state", "integer", ["null" => true]);
$voiceCallHistoryTable->addColumn("billable", "integer", ["null" => false, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
$voiceCallHistoryTable->addColumn("duration", "integer", ["null" => false]);
//VoiceCallHistory Table Indexes
$voiceCallHistoryTable->addIndex(["billable"]);
$voiceCallHistoryTable->addIndex(["voice_account"]);
//VoiceCallHistoryJob Table
$voiceCallHistoryJobTable = $this->table("VoiceCallHistoryJob", ["signed" => true]);
$voiceCallHistoryJobTable->addColumn("id", "integer", ["identity" => true]);
$voiceCallHistoryJobTable->addColumn("date", "date", ["null" => false]);
$voiceCallHistoryJobTable->addColumn("status", "enum", ["values" => ["created", "pending", "running", "success", "failed"], "default" => "created", "null" => false]);
$voiceCallHistoryJobTable->addColumn("finished", "date", ["null" => true]);
$voiceCallHistoryJobTable->addIndex(["date"], ["unique" => true]);
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$this->table("VoiceCallHistory")->drop()->save();
$this->table("VoiceCallHistoryJob")->drop()->save();
}
}
}