package app.closer.data.remote

/**
 * Single source of truth for all Firestore collection and fixed document-ID names.
 *
 * Use these constants everywhere instead of inline string literals so that a path
 * rename requires a change in exactly one place and the compiler catches every caller.
 */
object FirestoreCollections {

    // ── Top-level collections ─────────────────────────────────────────────────
    const val USERS = "users"
    const val COUPLES = "couples"
    const val INVITES = "invites"

    // ── Subcollections under users/{uid} ──────────────────────────────────────
    object Users {
        const val ENTITLEMENTS = "entitlements"
        const val FCM_TOKENS = "fcmTokens"
        const val ENTITLEMENT_PREMIUM_DOC = "premium"
        const val DEVICES = "devices"
        const val DEVICE_PRIMARY = "primary"
    }

    // ── Subcollections under couples/{coupleId} ───────────────────────────────
    object Couples {
        const val SESSIONS = "sessions"
        const val QUESTION_THREADS = "question_threads"
        const val CONVERSATIONS = "conversations"
        const val DATE_SWIPES = "date_swipes"
        const val DATE_MATCHES = "date_matches"
        const val DATE_PLAN_PREFERENCES = "date_plan_preferences"
        const val DATE_PLANS = "date_plans"
        const val BUCKET_LIST = "bucket_list"
        const val DAILY_QUESTION = "daily_question"
        const val CHALLENGES = "challenges"
        const val CAPSULES = "capsules"
        const val THIS_OR_THAT = "this_or_that"
        const val WHEEL = "wheel"
        const val DESIRE_SYNC = "desire_sync"
        const val HOW_WELL = "how_well"
    }

    // Standalone subcollection name that appears under both couples/{id} and users/{uid}
    const val OUTCOMES = "outcomes"

    // ── Subcollections under couples/{coupleId}/daily_question/{date} ───────────
    object DailyQuestion {
        const val ANSWERS = "answers"
    }

    // ── Subcollections under …/daily_question/{date}/answers/{userId} ─────────
    object Answers {
        const val RELEASE_KEYS = "releaseKeys"
    }

    // ── Subcollections under …/question_threads/{threadId} ────────────────────
    object QuestionThreads {
        const val ANSWERS = "answers"
        const val MESSAGES = "messages"
        const val REACTIONS = "reactions"
        const val RELEASE_KEYS = "releaseKeys"
    }

    // ── Subcollections under …/conversations/{conversationId} ─────────────────
    object Conversations {
        const val MESSAGES = "messages"
        const val MAIN_ID = "main"
    }
}
