if (!exists("meta") || is.null(meta)) {
  meta <- utils::packageDescription("surveyframe")
}

year <- if (!is.null(meta$Date) && nzchar(meta$Date)) {
  format(as.Date(meta$Date), "%Y")
} else {
  format(Sys.Date(), "%Y")
}

bibentry(
  bibtype  = "Manual",
  title    = "surveyframe: Survey Instrument Workflows",
  author   = person("Mohammed Ali", "Sharafuddin",
                    email = "mohammedali.page@gmail.com",
                    role  = c("aut", "cre"),
                    comment = c(ORCID = "0000-0001-5247-2964")),
  year     = year,
  note     = paste("R package version", meta$Version),
  url      = "https://github.com/MohammedAliSharafuddin/surveyframe"
)

bibentry(
  bibtype  = "Book",
  title    = paste("Quantitative Analysis with Small Samples:",
                    "A Practical Guide for Students and Early-Career Researchers"),
  author   = c(
    person("Mohammed Ali", "Sharafuddin"),
    person("A. A.", "Jaleel"),
    person("M.", "Madhavan")
  ),
  year     = "2026",
  publisher = "Zenodo",
  version  = "0.1.0",
  doi      = "10.5281/zenodo.20221929",
  url      = "https://doi.org/10.5281/zenodo.20221929",
  note     = paste("Companion textbook describing the small-sample methods",
                    "surveyframe adds in v0.4 and when to prefer each one.")
)

bibentry(
  bibtype  = "Unpublished",
  title    = paste("surveyframe: A Pre-Declared, Reproducible Framework",
                    "for Multi-Criteria Decision Analysis in Survey Research"),
  author   = person("Mohammed Ali", "Sharafuddin",
                    comment = c(ORCID = "0000-0001-5247-2964")),
  year     = "2026",
  note     = paste("Manuscript in preparation for Operations Research",
                    "and Decisions. Describes the 10 MCDM methods",
                    "surveyframe adds in v0.4.")
)
