Refactor backend for getting signed url

This commit is contained in:
2024-08-28 18:00:20 +02:00
parent 7ab52ff09e
commit 00cc3b7806
7 changed files with 345 additions and 135 deletions

View File

@@ -41,6 +41,7 @@ use Symfony\Component\Serializer\Annotation as Serializer;
class StoredObject implements Document, TrackCreationInterface
{
use TrackCreationTrait;
final public const STATUS_EMPTY = 'empty';
final public const STATUS_READY = 'ready';
final public const STATUS_PENDING = 'pending';
final public const STATUS_FAILURE = 'failure';
@@ -98,7 +99,7 @@ class StoredObject implements Document, TrackCreationInterface
*/
public function __construct(
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => 'ready'])]
private string $status = 'ready'
private string $status = 'empty'
) {
$this->uuid = Uuid::uuid4();
$this->versions = new ArrayCollection();
@@ -330,6 +331,10 @@ class StoredObject implements Document, TrackCreationInterface
$this->versions->add($version);
if ('empty' === $this->status) {
$this->status = self::STATUS_READY;
}
return $version;
}