package app.closer.crypto

/**
 * Single source of truth for couple encryption versions shared by Android,
 * iOS, and Cloud Functions.
 *
 * v0 = legacy plaintext (no couple key, all answer paths write plaintext).
 *      Used by the iOS MVP because E2EE is skipped for the initial port.
 * v1 = legacy Tink key migration-in-progress (mixed plaintext + encrypted).
 *      Kept for backwards compatibility with older couples; no new couples
 *      should be created at v1.
 * v2 = strict E2EE (all answer-bearing paths require a couple key and
 *      ciphertext). This is the default for all new Android couples.
 *
 * IMPORTANT: keep this mapping in sync with:
 *  - functions/src/couples/acceptInviteCallable.ts
 *  - iphone/ARCHITECTURE_AUDIT.md (E2EE section)
 *  - iphone/Closer/Services/FirestoreService.swift (couple creation TODOs)
 */
object EncryptionVersion {
    const val PLAINTEXT = 0
    const val MIGRATING = 1
    const val STRICT = 2

    /** Version used when creating a new couple from the Android client. */
    const val NEW_COUPLE_DEFAULT = STRICT
}
