#pragma once

inline bool IsDocOutdated(ui32 versionCurrent, ui32 versionPrevious, ui32 timestampCurrent,
                                        ui32 timestampPrevious, bool timestampControlEnabled) {
    bool outdatedByVersion = versionCurrent < versionPrevious && versionCurrent;
    bool outdatedByTimetamp = versionCurrent == versionPrevious && (timestampCurrent < timestampPrevious) && timestampCurrent;
    return outdatedByVersion || (timestampControlEnabled && outdatedByTimetamp);
}
