feat: add deployments as activity

fix: tests
refactor: remoteProcess
This commit is contained in:
Andras Bacsai
2023-03-29 12:27:02 +02:00
parent 9019d1484e
commit 78c4344583
15 changed files with 81 additions and 81 deletions

View File

@@ -10,10 +10,23 @@ class DispatchRemoteProcess
{
protected Activity $activity;
public function __construct(RemoteProcessArgs $remoteProcessArgs){
$this->activity = activity()
->withProperties($remoteProcessArgs->toArray())
->log("");
public function __construct(RemoteProcessArgs $remoteProcessArgs)
{
if ($remoteProcessArgs->model) {
$properties = $remoteProcessArgs->toArray();
unset($properties['model']);
$this->activity = activity()
->withProperties($properties)
->performedOn($remoteProcessArgs->model)
->event('deployment')
->log("");
} else {
$this->activity = activity()
->withProperties($remoteProcessArgs->toArray())
->event('remote_process')
->log("");
}
}
public function __invoke(): Activity