Skip to content

Commit

Permalink
bug: fix test issues related to validation of method param types
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig committed Sep 3, 2024
1 parent 0de6124 commit 467d68a
Show file tree
Hide file tree
Showing 8 changed files with 54,721 additions and 94 deletions.
12 changes: 7 additions & 5 deletions R/entrata_leases.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ 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 All @@ -86,10 +88,10 @@ entrata_leases <- function(
leaseExpiringDateTo = lease_expiring_date_to,
moveOutDateFrom = move_out_date_from,
moveOutDateTo = move_out_date_to,
includeOtherIncomeLeases = include_other_income_leases,
residentFriendlyMode = resident_friendly_mode,
includeLeaseHistory = include_lease_history,
includeArTransactions = include_ar_transactions
includeOtherIncomeLeases = as.character(as.integer(include_other_income_leases)),
residentFriendlyMode = as.character(as.integer(resident_friendly_mode)),
includeLeaseHistory = as.character(as.integer(include_lease_history)),
includeArTransactions = as.character(as.integer(include_ar_transactions))
) |>
purrr::compact()

Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
111 changes: 89 additions & 22 deletions data-raw/entrata/entrata_endpoints.R
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ entrata_api_request_parameters <- list(
),

Check warning on line 274 in data-raw/entrata/entrata_endpoints.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/entrata/entrata_endpoints.R,line=274,col=4,[indentation_linter] Indentation should be 2 spaces but is 4 spaces.

Check warning on line 274 in data-raw/entrata/entrata_endpoints.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/entrata/entrata_endpoints.R,line=274,col=4,[indentation_linter] Indentation should be 2 spaces but is 4 spaces.
"customers" = list(
"getCustomers" = list(
propertyId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value for the Property ID."),
propertyId = list(type = "string", required = TRUE, description = "This is a required field. This field accepts single value for the Property ID."),

Check warning on line 277 in data-raw/entrata/entrata_endpoints.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/entrata/entrata_endpoints.R,line=277,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 154 characters.

Check warning on line 277 in data-raw/entrata/entrata_endpoints.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/entrata/entrata_endpoints.R,line=277,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 154 characters.
"customerIds" = list(
type = "string",
required = FALSE,
Expand Down Expand Up @@ -302,7 +302,7 @@ entrata_api_request_parameters <- list(
),
"financial" = list(
"getBudgetActuals" = list(
propertyId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value. propertyId"),
propertyId = list(type = "string", required = TRUE, description = "This is a required field. This field accepts single value. propertyId"),
glTreeId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value."),
budgetId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value."),
postMonthFrom = list(type = "string", required = TRUE, description = "This is a required field. This field accepts single value. MM/YYYY"),
Expand All @@ -312,7 +312,7 @@ entrata_api_request_parameters <- list(
accountingMethod = list(type = "string", required = TRUE, description = "This is a required field. This field accepts single value. accountingMethod")
),
"getBudgets" = list(
propertyId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value. propertyId"),
propertyId = list(type = "string", required = TRUE, description = "This is a required field. This field accepts single value. propertyId"),
"budgetIds" = list(
type = "string",
required = FALSE,
Expand All @@ -336,7 +336,7 @@ entrata_api_request_parameters <- list(
"leases" = list(
"getLeases" = list(
propertyId = list(
type = "integer",
type = "string",
required = TRUE,
description = "This is a required field. This field accepts single value."
),
Expand All @@ -345,26 +345,93 @@ entrata_api_request_parameters <- list(
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
customerId = list(type = "integer", required = FALSE, description = "This is an optional field. This field accepts single value."),
leaseStatusTypeIds = list(type = "integer", required = FALSE, multiple = TRUE, description = "This is an optional field. This field accepts comma separated multiple values."),
leaseIds = list(type = "integer", required = FALSE, multiple = TRUE, description = "This is an optional field. This field accepts comma separated multiple values."),
scheduledArCodeIds = list(type = "integer", required = FALSE, multiple = TRUE, description = "This is an optional field. This field accepts comma separated multiple values."),
unitNumber = list(type = "string", required = FALSE, description = "This is an optional field. This field accepts single value."),
buildingName = list(type = "string", required = FALSE, description = "This is an optional field. This field accepts single value."),
moveInDateFrom = list(type = "date", required = FALSE, description = "This is an optional field. This field accepts single value."),
moveInDateTo = list(type = "date", required = FALSE, description = "This is an optional field. This field accepts single value."),
leaseExpiringDateFrom = list(type = "date", required = FALSE, description = "This is an optional field. This field accepts single value."),
leaseExpiringDateTo = list(type = "date", required = FALSE, description = "This is an optional field. This field accepts single value."),
moveOutDateFrom = list(type = "date", required = FALSE, description = "This is an optional field. This field accepts single value."),
moveOutDateTo = list(type = "date", required = FALSE, description = "This is an optional field. This field accepts single value."),
includeOtherIncomeLeases = list(type = "boolean_string", required = FALSE, description = "This is an optional field. This field accepts single value."),
residentFriendlyMode = list(type = "boolean_string", required = FALSE, description = "This is an optional field. This field accepts single value."),
includeLeaseHistory = list(type = "boolean_string", required = FALSE, description = "This is an optional field. This field accepts single value."),
includeArTransactions = list(type = "boolean_string", required = FALSE, description = "This is an optional field. This field accepts single value. This should return the Ar Transactions associated with the lease.")
customerId = list(
type = "integer",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
leaseStatusTypeIds = list(
type = "integer",
required = FALSE,
multiple = TRUE,
description = "This is an optional field. This field accepts comma separated multiple values."
),
leaseIds = list(
type = "integer",
required = FALSE,
multiple = TRUE,
description = "This is an optional field. This field accepts comma separated multiple values."
),
scheduledArCodeIds = list(
type = "integer",
required = FALSE,
multiple = TRUE,
description = "This is an optional field. This field accepts comma separated multiple values."
),
unitNumber = list(
type = "string",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
buildingName = list(
type = "string",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
moveInDateFrom = list(
type = "date",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
moveInDateTo = list(
type = "date",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
leaseExpiringDateFrom = list(
type = "date",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
leaseExpiringDateTo = list(
type = "date",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
moveOutDateFrom = list(
type = "date",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
moveOutDateTo = list(
type = "date",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
includeOtherIncomeLeases = list(
type = "boolean_string",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
residentFriendlyMode = list(
type = "boolean_string",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
includeLeaseHistory = list(
type = "boolean_string",
required = FALSE,
description = "This is an optional field. This field accepts single value."
),
includeArTransactions = list(
type = "boolean_string",
required = FALSE,
description = "This is an optional field. This field accepts single value. This should return the Ar Transactions associated with the lease."
)
),
# Add other methods for the "leases" endpoint here
"getLeaseDetails" = list(
propertyId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value."),
propertyId = list(type = "string", required = TRUE, description = "This is a required field. This field accepts single value."),
leaseId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value."),
leaseStatusTypeIds = list(type = "integer", required = FALSE, multiple = TRUE, description = "This is an optional field. This field accepts comma separated multiple values."),
includeAddOns = list(type = "boolean_string", required = FALSE, description = "This is an optional field. This field accepts single value."),
Expand All @@ -385,7 +452,7 @@ entrata_api_request_parameters <- list(
showDeletedFile = list(type = "boolean_string", required = FALSE, description = "This is an optional field. This field accepts single value. If provided, this will return the documents which have been deleted.")
),
"getLeaseDocumentsList" = list(
propertyId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value."),
propertyId = list(type = "string", required = TRUE, description = "This is a required field. This field accepts single value."),
leaseId = list(type = "integer", required = TRUE, description = "This is a required field. This field accepts single value."),
externalLeaseId = list(type = "string", required = FALSE, description = "This is an optional field. This field accepts single value. Its remote primary key which is associated to lease."),
fileTypesCode = list(
Expand Down
Loading

0 comments on commit 467d68a

Please sign in to comment.