V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
namespace Shared.Operations;
|
||||
|
||||
public static class ReconcilePolicy
|
||||
{
|
||||
public static string DecideStatus(
|
||||
bool valuesMatch,
|
||||
DateTimeOffset sourceChangedAt,
|
||||
DateTimeOffset observedAt,
|
||||
TimeSpan gracePeriod)
|
||||
{
|
||||
if (valuesMatch) return "matched";
|
||||
if (observedAt < sourceChangedAt) throw new ArgumentOutOfRangeException(nameof(observedAt));
|
||||
return observedAt - sourceChangedAt < gracePeriod ? "pending" : "mismatch";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user