Feature: Implement multi-stage Conversation Flow Engine with TestFlow

This commit is contained in:
Hamza-Ayed
2026-05-22 05:11:35 +03:00
parent b82a02f6fa
commit 7ec4d9becb
11 changed files with 737 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
<?php
namespace App\Core\Flows;
/**
* FlowResult
* Holds response details after handling a single step in a conversation flow.
*/
class FlowResult
{
private string $replyText;
private string $nextStep;
private bool $finished;
private ?string $mediaUrl;
public function __construct(string $replyText, string $nextStep, bool $finished = false, ?string $mediaUrl = null)
{
$this->replyText = $replyText;
$this->nextStep = $nextStep;
$this->finished = $finished;
$this->mediaUrl = $mediaUrl;
}
/**
* Get the reply message text to send to the contact
*/
public function getReplyText(): string
{
return $this->replyText;
}
/**
* Get the next step key
*/
public function getNextStep(): string
{
return $this->nextStep;
}
/**
* Check if the flow is finished (to be destroyed)
*/
public function isFinished(): bool
{
return $this->finished;
}
/**
* Get target media URL (if any)
*/
public function getMediaUrl(): ?string
{
return $this->mediaUrl;
}
}