Big changes added events for decisions
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Event;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class EventSeeder extends Seeder
|
||||
{
|
||||
@@ -13,12 +13,39 @@ class EventSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$events = [
|
||||
[ 'name' => 'client_case.terrain.add', 'options' => json_encode([]) ]
|
||||
// Seed the new decision event type(s)
|
||||
// Use query builder to satisfy legacy NOT NULL "options" column
|
||||
$rows = [
|
||||
[
|
||||
'key' => 'add_segment',
|
||||
'name' => 'Add segment',
|
||||
'description' => 'Activates a target segment for a contract and deactivates previous ones.',
|
||||
],
|
||||
[
|
||||
'key' => 'archive_contract',
|
||||
'name' => 'Archive contract',
|
||||
'description' => 'Runs ArchiveExecutor for the activity\'s contract using a specified ArchiveSetting.',
|
||||
],
|
||||
[
|
||||
'key' => 'end_field_job',
|
||||
'name' => 'End field job',
|
||||
'description' => 'Dispatches a queued job to finalize field-related processing (implementation-specific).',
|
||||
],
|
||||
];
|
||||
|
||||
foreach($events as $e) {
|
||||
Event::create($e);
|
||||
foreach ($rows as $row) {
|
||||
DB::table('events')->updateOrInsert(
|
||||
['key' => $row['key']],
|
||||
[
|
||||
'name' => $row['name'],
|
||||
'description' => $row['description'],
|
||||
'active' => true,
|
||||
'config' => json_encode([]),
|
||||
'options' => json_encode([]),
|
||||
'updated_at' => now(),
|
||||
'created_at' => now(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user