R/plant.R

Defines functions lds_get_plant lds_post_plant lds_post_harvest_plant

Documented in lds_get_plant lds_post_plant

#' Get information about area
#' @export
lds_get_plant <- function(...) {
  
  lds_call("plants", "GET", query = ...)
  
}

#' Create area
#' @export
lds_post_plant <- function(origin, plant_created_at, stage, global_batch_id) {
  
  lds_call("plants", "POST", body = list(
    plant = data.frame(
      origin, plant_created_at, stage, global_batch_id
    )
  ))
  
}

#' @export
lds_post_harvest_plant <- function(external_id = NA, harvested_at, qty_harvest, uom,
                                   global_area_id, global_harvest_batch_id = NA, 
                                   global_plant_ids) {
  lds_call("plants/harvest_plants", "POST", body = list(
    external_id = external_id, harvested_at = harvested_at, 
    qty_harvest = qty_harvest, uom = uom,
    global_area_id = global_area_id, global_harvest_batch_id = global_harvest_batch_id, 
    global_plant_ids = data.frame(global_plant_id = global_plant_ids)
  ))
  
}
CannaData/CannaLeafDataSystems documentation built on May 17, 2019, 8:03 a.m.