Skip to contents

If supplied with at least a name, create a new record for a partner in the database.

Usage

insert_partner(
  name = NA,
  type = c("Charitable Trust", "Incorporated Society", "Other"),
  facility_owner = TRUE,
  service_provider = TRUE,
  legal_status_number = NA,
  facility_id = NA,
  facility_type = NA,
  test_db = FALSE
)

Arguments

name

The name of the partner that is being added to the database. This is the minimum information that should be supplied.

type

Is this partner a Charitable Trust, an Incorporated Society, or Other? Default to Charitable Trust.

facility_owner

Does this partner own the facility in which they operate (TRUE) or not (FALSE)? Defaults to TRUE.

service_provider

Does this partner provide services (TRUE) or not (FALSE)? Defaults to TRUE.

legal_status_number

The Legal Status Number for this partner, if available.

facility_id

If this partner is associated with a facility, this is the ID for that facility in the database.

facility_type

If this partner is associated with a facility, this is the type ("Asset", "Space", or "Entity") for that facility in the database.

test_db

Is this connection to the test database (TRUE) or not (FALSE)? Defaults to FALSE.

Value

A data frame with one row containing the newly-added entry.

Examples

insert_partner(name = "Hobbiton Charitable Trust", facility_owner = FALSE, test_db = TRUE)
#>   id                      name             type facility_owner service_provider
#> 1 P2 Hobbiton Charitable Trust Charitable Trust          FALSE             TRUE
#>   legal_status_number
#> 1                  NA