// SPDX-FileCopyrightText: 2026 FocusFlow contributors
// SPDX-License-Identifier: AGPL-3.0-only

part of '../../persistence_contract.dart';

/// Civil-date storage convention for future document persistence.
abstract final class PersistenceCivilDateConvention {
  /// Human-readable convention kept close to the helper for tests and docs.
  static const description =
      'Store CivilDate values as YYYY-MM-DD strings without timezone conversion.';

  /// Convert a CivilDate into the persisted string convention.
  static String toStoredString(CivilDate value) {
    return value.toIsoString();
  }

  /// Parse a persisted CivilDate string without applying a timezone.
  static CivilDate fromStoredString(String value) {
    return CivilDate.fromIsoString(value);
  }
}
