Repo Interface für tests

This commit is contained in:
2026-03-05 08:26:51 +01:00
parent 8f4dd5840d
commit 4b31fc7664
171 changed files with 3518 additions and 2297 deletions

View File

@@ -6,7 +6,7 @@ use MintyPHP\Domain\Taxonomy\ScheduledJobStatus;
use MintyPHP\DB;
use MintyPHP\Repository\Support\RepoQuery;
class ScheduledJobRepository
class ScheduledJobRepository implements ScheduledJobRepositoryInterface
{
public function create(array $data): int|false
{

View File

@@ -0,0 +1,30 @@
<?php
namespace MintyPHP\Repository\Scheduler;
interface ScheduledJobRepositoryInterface
{
public function create(array $data): int|false;
public function find(int $id): ?array;
public function findByKey(string $jobKey): ?array;
public function listPaged(array $filters): array;
public function listDueJobs(string $nowUtc, int $limit = 20): array;
public function updateJobMeta(int $id, array $data): bool;
public function markRunning(int $id, string $startedAtUtc): bool;
public function finishRun(
int $id,
string $status,
string $startedAtUtc,
string $finishedAtUtc,
?string $nextRunAtUtc,
?string $errorCode,
?string $errorMessage
): bool;
}

View File

@@ -7,7 +7,7 @@ use MintyPHP\Domain\Taxonomy\ScheduledJobTriggerType;
use MintyPHP\DB;
use MintyPHP\Repository\Support\RepoQuery;
class ScheduledJobRunRepository
class ScheduledJobRunRepository implements ScheduledJobRunRepositoryInterface
{
public function create(array $data): int|false
{

View File

@@ -0,0 +1,12 @@
<?php
namespace MintyPHP\Repository\Scheduler;
interface ScheduledJobRunRepositoryInterface
{
public function create(array $data): int|false;
public function listPagedByJobId(int $jobId, array $filters): array;
public function purgeOlderThanDays(int $days): int;
}

View File

@@ -5,7 +5,7 @@ namespace MintyPHP\Repository\Scheduler;
use MintyPHP\Domain\Taxonomy\SchedulerRuntimeResult;
use MintyPHP\DB;
class SchedulerRuntimeRepository
class SchedulerRuntimeRepository implements SchedulerRuntimeRepositoryInterface
{
public function touchHeartbeat(string $result, ?string $errorCode = null, ?string $heartbeatAtUtc = null): bool
{

View File

@@ -0,0 +1,10 @@
<?php
namespace MintyPHP\Repository\Scheduler;
interface SchedulerRuntimeRepositoryInterface
{
public function touchHeartbeat(string $result, ?string $errorCode = null, ?string $heartbeatAtUtc = null): bool;
public function findStatus(): ?array;
}