-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
pt_validate_vms_installs() used to check that an IMEI was uniquely associated with a single boat. However, it later became evident that some devices were moved between boats, particularly early in the installation period. Consequently, this test (see code below) was deactivated.
v <- vms_installs_table %>%
dplyr::mutate(device_event_date = lubridate::as_date(.data$device_event_date),
createdTime = lubridate::ymd_hms(.data$createdTime),
created_date = lubridate::as_date(.data$created_date))
ok_boat_installs <- v %>%
dplyr::group_by(.data$device_imei) %>%
dplyr::summarise(n_boats = dplyr::n_distinct(.data$boat_id),
.groups = "drop")
if (any(ok_boat_installs$n_boats > 1))
stop("detected a vms device in more than one boat")A new test is needed where the consistency of devices and boats is still validated. The test needs to acknowledge that IMEIS can be associated to multiple boats but not at the same time.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request