Workorder mph/improve

This commit is contained in:
Luca Haid
2025-12-13 21:27:43 +00:00
parent 1435923200
commit 0755df5408
19 changed files with 658 additions and 122 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddWorkorderMphPermissions extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("WorkerPermission");
$table->addColumn("canWorkorderMphAdmin", "enum", ["values" => 'false,true', "default" => "false", "after" => "canRMLAdmin"]);
$table->addColumn("canWorkorderMph", "enum", ["values" => 'false,true', "default" => "false", "after" => "canWorkorderMphAdmin"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("WorkerPermission")->removeColumn("canWorkorderMphAdmin")->save();
$this->table("WorkerPermission")->removeColumn("canWorkorderMph")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddWorkorderTenantConfigModuleFlags extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table('WorkorderTenantConfig');
$table->addColumn('enableWorkorder', 'boolean', [
'default' => true,
'null' => false,
'after' => 'requireCableType',
'comment' => 'Enable Workorder module for this tenant'
]);
$table->addColumn('enableWorkorderMph', 'boolean', [
'default' => true,
'null' => false,
'after' => 'enableWorkorder',
'comment' => 'Enable WorkorderMPH module for this tenant'
]);
$table->update();
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table('WorkorderTenantConfig')
->removeColumn('enableWorkorder')
->removeColumn('enableWorkorderMph')
->save();
}
}
}