Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/noclocks/gmhleasr into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
jimbrig committed Aug 29, 2024
2 parents 74517f6 + 517f202 commit cedcdfc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 27 deletions.
19 changes: 8 additions & 11 deletions R/entrata_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion R/entrata_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ validate_entrata_config <- function(cfg) {
}

cfg <- cfg$entrata

}

if ("default" %in% names(cfg)) {
Expand Down
4 changes: 1 addition & 3 deletions R/entrata_leases.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
17 changes: 8 additions & 9 deletions R/entrata_reports.R
Original file line number Diff line number Diff line change
Expand Up @@ -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() |>
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -313,8 +313,6 @@ prep_pre_lease_report_params <- function(
subtotals = list("summary", "details"),
yoy = 1,
...) {


list(
reportName = "pre_lease",
reportVersion = latest_report_version,
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand All @@ -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

Expand Down
4 changes: 1 addition & 3 deletions R/entrata_request.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ entrata <- function(
dry_run = FALSE,
progress = FALSE,
config = config::get("entrata"),
...
) {

...) {
base_url <- config$base_url

if (is.null(method)) {
Expand Down

0 comments on commit cedcdfc

Please sign in to comment.