feat: improved contingents api performance with db backed snapshots

This commit is contained in:
Björn Fromme
2026-08-20 11:46:03 +02:00
parent d5f9f4ef10
commit 351fbab498
20 changed files with 1521 additions and 109 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Model;
/**
* Outcome of a single accommodation's contingent snapshot sync.
*/
readonly class ContingentSyncResult
{
private function __construct(
public bool $successful,
public bool $changed,
public int $added,
public int $updated,
public int $removed,
public ?string $error = null,
) {
}
public static function synced(bool $changed, int $added, int $updated, int $removed): self
{
return new self(true, $changed, $added, $updated, $removed);
}
public static function failed(string $error): self
{
return new self(false, false, 0, 0, 0, $error);
}
}