fix: derive contingent change signal from the sync diff

This commit is contained in:
2026-09-11 19:34:29 +02:00
parent e863025fb1
commit 5f8a586385
8 changed files with 87 additions and 73 deletions
+8 -3
View File
@@ -13,19 +13,24 @@ readonly class ContingentSyncResult
public bool $successful,
public bool $changed,
public int $added,
public int $extended,
public int $updated,
public int $removed,
public ?string $error = null,
) {
}
public static function synced(bool $changed, int $added, int $updated, int $removed): self
/**
* $added counts days newly stored within the horizon the previous run already reached;
* $extended counts days beyond it, which is the rolling window growing rather than a change.
*/
public static function synced(bool $changed, int $added, int $extended, int $updated, int $removed): self
{
return new self(true, $changed, $added, $updated, $removed);
return new self(true, $changed, $added, $extended, $updated, $removed);
}
public static function failed(string $error): self
{
return new self(false, false, 0, 0, 0, $error);
return new self(false, false, 0, 0, 0, 0, $error);
}
}