package dev.privacyllc.period.feature.export

import java.time.LocalDate
import java.time.format.DateTimeFormatter

/**
 * Everything the export screen says, in one place so it can be tested.
 *
 * The disclosure is the substance of this feature, not decoration around it.
 * Exporting is the single moment health data leaves the app's sandbox, and the
 * app's own protections stop at the edge of that file — so the screen says so
 * before the picker opens, not after.
 */
internal object ExportCopy {

    const val ROW_TITLE = "Export my data"
    const val ROW_SUBTITLE = "Save a copy of your records somewhere you choose"

    const val TITLE = "Export my data"

    const val WHAT_HEADING = "What you get"
    const val WHAT_BODY =
        "One file holding every period and spotting entry you have logged, and your " +
            "settings. It is plain text you can open and read.\n\n" +
            "Nothing else goes in it: no predictions, no averages, nothing about your " +
            "phone, and nothing that was ever sent anywhere."

    const val WHERE_HEADING = "Where it goes"
    const val WHERE_BODY =
        "You choose. The next screen is your phone's own save dialog, and the file is " +
            "written straight there — no copy is kept inside the app."

    /**
     * The load-bearing paragraph, and it is paid for immediately by the line
     * that follows it.
     *
     * A user who has just set a PIN reasonably assumes it protects everything
     * this app touches. It does not reach a file that has left, and saying so is
     * the difference between a feature and a trap.
     */
    const val PROTECTION_HEADING = "Your PIN does not protect the file"
    const val PROTECTION_BODY =
        "The file is not encrypted, and the app lock has no reach over it. Anyone who " +
            "can open the folder you save it to can read it, and a folder that syncs " +
            "will take it wherever it syncs.\n\n" +
            "That is the trade for having your own copy: nothing here is backed up " +
            "anywhere, so this file is the only way your records can outlive this phone."

    const val ACTION = "Choose where to save"
    const val WORKING = "Saving…"

    const val DONE = "Saved. Your records are in the file you chose."
    const val FAILED = "Nothing was saved, and your records are intact."
    const val FAILED_PARTIAL =
        "Something went wrong while saving, and an incomplete file may be left where " +
            "you chose. Delete it and try again — your records here are intact."
    const val ACKNOWLEDGE = "Done"

    /**
     * `records-2026-08-19.json`.
     *
     * Checked against `NotificationCopy.SENSITIVE_WORDS`: the name is visible in
     * a file picker, a downloads list and a sync notification, so it must not
     * say what the app is for. "records" is deliberately dull.
     *
     * The date is the day the file was saved, not a cycle date — it is what
     * makes two archives distinguishable in a folder. Identity lives inside the
     * file's `format` field, never in its name.
     */
    fun fileName(on: LocalDate): String =
        "records-${on.format(DateTimeFormatter.ISO_LOCAL_DATE)}.json"
}
