diff --git a/R/entrata_api.R b/R/entrata_api.R index bff2620..0a8ea69 100644 --- a/R/entrata_api.R +++ b/R/entrata_api.R @@ -48,17 +48,14 @@ EntrataAPI <- R6::R6Class( #' #' @return The response object from the API request. #' @export - send_request = function( - endpoint, - method, - method_version = "r1", - method_params = list(), - enable_retry = FALSE, - timeout = NULL, - progress = FALSE, - ... - ) { - + send_request = function(endpoint, + method, + method_version = "r1", + method_params = list(), + enable_retry = FALSE, + timeout = NULL, + progress = FALSE, + ...) { validate_entrata_endpoint_method(endpoint, method) validate_entrata_method_params(endpoint, method, method_params) diff --git a/R/entrata_config.R b/R/entrata_config.R index a6647d0..621d46d 100644 --- a/R/entrata_config.R +++ b/R/entrata_config.R @@ -28,7 +28,6 @@ validate_entrata_config <- function(cfg) { } cfg <- cfg$entrata - } if ("default" %in% names(cfg)) { diff --git a/R/entrata_leases.R b/R/entrata_leases.R index e5050ab..0cf020c 100644 --- a/R/entrata_leases.R +++ b/R/entrata_leases.R @@ -64,9 +64,7 @@ entrata_leases <- function( pagination_page_number = 1, pagination_page_size = 500, include_pagination_links = FALSE, - ... -) { - + ...) { if (length(property_id) > 1) { cli::cli_alert_warning("The {.field getLeases} method requires a single {.field propertyId}.") property_id <- property_id[[1]] diff --git a/R/entrata_reports.R b/R/entrata_reports.R index 17513c9..4866c5b 100644 --- a/R/entrata_reports.R +++ b/R/entrata_reports.R @@ -16,7 +16,6 @@ #' @importFrom dplyr filter pull #' @importFrom memoise memoise validate_entrata_report_name <- function(report_name) { - mem_reports_list <- memoise::memoise(get_entrata_reports_list) report_names <- mem_reports_list() |> @@ -249,7 +248,8 @@ get_entrata_report_info <- function(report_name, report_version = "latest") { res_report_name <- res_content |> purrr::pluck("name") res_report_description <- res_content |> purrr::pluck("description") - res_report_filters <- res_content |> purrr::pluck("filters", "filter") |> + res_report_filters <- res_content |> + purrr::pluck("filters", "filter") |> purrr::map(tibble::as_tibble) |> purrr::list_rbind() @@ -313,8 +313,6 @@ prep_pre_lease_report_params <- function( subtotals = list("summary", "details"), yoy = 1, ...) { - - list( reportName = "pre_lease", reportVersion = latest_report_version, @@ -363,7 +361,6 @@ entrata_pre_lease_report <- function( property_ids = c(NULL), period_start = "09/01/2024", ...) { - latest_report_version <- mem_get_latest_report_version("pre_lease") property_group_ids <- mem_get_property_ids_filter_param() @@ -406,10 +403,12 @@ entrata_pre_lease_report <- function( httr2::resp_body_json() |> purrr::pluck("response", "result", "reportData") - res_data_summary <- res_content |> purrr::pluck("summary") |> + res_data_summary <- res_content |> + purrr::pluck("summary") |> dplyr::bind_rows() - res_data_details <- res_content |> purrr::pluck("details") |> + res_data_details <- res_content |> + purrr::pluck("details") |> dplyr::bind_rows() leasing_season_ending <- lubridate::ymd("2025-08-01") @@ -445,7 +444,7 @@ entrata_pre_lease_report <- function( current_occupency = occupied_count / total_beds, # Total Leases / Total Beds total_new = approved_new_count + partially_completed_new_count + completed_new_count, total_renewals = approved_renewal_count + partially_completed_renewal_count + completed_renewal_count, - total_leases = total_new + total_renewals, #leases_count, + total_leases = total_new + total_renewals, # leases_count, prelease_percent = approved_percent, # prelease_percent = units / approved_count, # total beds / total leases prior_total_new = approved_new_count_prior + partially_completed_new_count_prior + completed_new_count_prior, @@ -463,7 +462,7 @@ entrata_pre_lease_report <- function( vel_90 = beds_left * .9 / weeks_left_to_lease, vel_95 = beds_left * .95 / weeks_left_to_lease, vel_100 = beds_left * 1 / weeks_left_to_lease - ) + ) res_data_details_out <- res_data_details diff --git a/R/entrata_request.R b/R/entrata_request.R index 130c9c5..bc1c8f5 100644 --- a/R/entrata_request.R +++ b/R/entrata_request.R @@ -165,9 +165,7 @@ entrata <- function( dry_run = FALSE, progress = FALSE, config = config::get("entrata"), - ... -) { - + ...) { base_url <- config$base_url if (is.null(method)) {