@medic/cht-datasource
    Preparing search index...

    Function create

    • Returns a function for creating a place from the given data context.

      Parameters

      Returns (input: PlaceInput) => Promise<Place.v1.Place>

      a function for creating a place.

        • (input: PlaceInput): Promise<Place.v1.Place>
        • Creates a new place record.

          Parameters

          • input: PlaceInput

            input fields for creating a place

          Returns Promise<Place.v1.Place>

          the created place record

          InvalidArgumentError if type is not provided or is not a supported place contact type

          InvalidArgumentError if name is not provided

          InvalidArgumentError if parent is not provided for types requiring a parent or is not the identifier of a valid contact. The parent contact's type must be one of the supported parent contact types for the new place.

          InvalidArgumentError if the provided reported_date is not in a valid format. Valid formats are 'YYYY-MM-DDTHH:mm:ssZ', 'YYYY-MM-DDTHH:mm:ss.SSSZ', or .

          InvalidArgumentError if the provided contact is not the identifier of a valid person contact

      Error if a data context is not provided