#' Deactivate the records of the specified data frame.
#' 
#' This helper function is used in the context of a Slowly Changing Dimension
#' (SCD) to mark active records of a data frame as not active with an end date.
#' 
#' @param dataframe `data.frame`. The data frame to deactivate.
#' 
#' @return The specified data frame with IS_ACTIVE set to FALSE and END_DATE set
#'   to current time.
#'
#' @importFrom checkmate assert_data_frame
#' @importFrom dplyr mutate
#'
#' @keywords internal
#' @noRd
#' 
.deactivate <- function(dataframe) {

  assert_data_frame(dataframe)
  
  deactivatedDataframe_ <- dataframe |> mutate(
    IS_ACTIVE = FALSE,
    END_DATE = Sys.time()
  )

  return(deactivatedDataframe_)
}
