Add strict_types to automation files and AutomationNodeState factory

This commit is contained in:
Paulo Castellano 2026-06-10 17:26:50 -03:00
parent 41edf3123d
commit 6d3a375add
36 changed files with 93 additions and 0 deletions

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use App\Enums\Automation\Node\Type as NodeType;

View file

@ -5,11 +5,13 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class AutomationNodeState extends Model
{
use HasFactory;
use HasUuids;
protected $guarded = [];

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use App\Enums\Automation\Run\Status;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Http\Middleware\Api\LoadWorkspaceFromToken;
use App\Http\Middleware\App\EnsureRegistrationEnabled;
use App\Http\Middleware\App\HandleInertiaRequests;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Enums\Automation\Status;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Enums\Automation\Node\Type as NodeType;

View file

@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\Automation;
use App\Models\AutomationNodeState;
use Illuminate\Database\Eloquent\Factories\Factory;
class AutomationNodeStateFactory extends Factory
{
protected $model = AutomationNodeState::class;
public function definition(): array
{
return [
'automation_id' => Automation::factory(),
'node_id' => 'node_'.fake()->randomNumber(6),
'data' => [],
];
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Enums\Automation\Run\Status;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Models\Automation;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
'title' => 'Automations',
'default_name' => 'New automation',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
'workspaces' => 'Workspaces',
'select_workspace' => 'Select workspace',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
'title' => 'Automatizaciones',
'default_name' => 'Nueva automatización',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
'workspaces' => 'Workspaces',
'select_workspace' => 'Seleccionar workspace',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
'title' => 'Automações',
'default_name' => 'Nova automação',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
return [
'workspaces' => 'Espaços de trabalho',
'select_workspace' => 'Selecionar workspace',

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Http\Resources\AutomationResource;
use App\Models\Automation;
use Illuminate\Support\Facades\Crypt;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Enums\Automation\Status;
use App\Models\Automation;
use App\Models\AutomationNodeRun;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunConditionNode;
use App\Models\AutomationRun;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunDelayNode;
use App\Enums\Automation\NodeRun\Status;
use App\Models\AutomationRun;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunEndNode;
use App\Enums\Automation\NodeRun\Status;
use App\Models\AutomationRun;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunFetchRssNode;
use App\Enums\Automation\NodeRun\Status as NodeRunStatus;
use App\Jobs\Automation\ProcessAutomationNode;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunGenerateNode;
use App\Ai\Agents\PostContentGenerator;
use App\Ai\Agents\PostContentHumanizer;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunHttpRequestNode;
use App\Enums\Automation\NodeRun\Status as NodeRunStatus;
use App\Jobs\Automation\ProcessAutomationNode;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunPublishNode;
use App\Enums\Post\Status as PostStatus;
use App\Jobs\PublishPost;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Node\RunWebhookNode;
use App\Enums\Automation\NodeRun\Status;
use App\Models\AutomationRun;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\TriggerItem\EnrollTriggerItem;
use App\Ai\Agents\PostContentGenerator;
use App\Ai\Agents\PostContentHumanizer;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Run\TestAutomation;
use App\Enums\Automation\Run\Status;
use App\Enums\Post\Status as PostStatus;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Enums\Post\Status as PostStatus;
use App\Jobs\Automation\ProcessAutomationNode;
use App\Models\Automation;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Actions\Automation\Trigger\FireScheduleTrigger;
use App\Models\Automation;
use App\Models\AutomationTriggerItem;

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use App\Services\Automation\ExpressionResolver;
beforeEach(function () {