RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

Class

PrePackSampleController

Controller Class for PrePack Samples

Constructor

new PrePackSampleController()

Source

Methods

static

create(siteId, createData) → {Promise.<PrePackSampleModel>}

Create a PrePack Sample [POST /packhouse/sites/{siteId}/prepack-samples]

Parameters

  • siteId number

    The Site ID

  • createData PrePackSampleController.CreateData

    The PrePack Sample Create Data

Returns

  • Promise.<PrePackSampleModel>

Source

static

createComment(siteId, id, content) → {Promise.<PrePackSampleController.CommentItem>}

Create a Comment [POST /packhouse/sites/{siteId}/prepack-samples/{id}/comments]

Create a Comment for a PrePack Sample

Parameters

  • siteId number

    The Site ID

  • id string

    The PrePack Sample ID

  • content string

    The Content of the New Comment

Returns

  • Promise.<PrePackSampleController.CommentItem>

Source

static

deleteOneComment(siteId, id, commentId) → {Promise.<boolean>}

Delete a Comment [DELETE /packhouse/sites/{siteId}/prepack-samples/{id}/comments/{commentId}]

Delete a Comment for a PrePack Sample

Parameters

  • siteId number

    The Site ID

  • id string

    The PrePack Sample ID

  • commentId string

    The Comment ID

Returns

  • Promise.<boolean>

Source

static

getAll(siteId, queryParametersopt) → {Promise.<Array.<PrePackSampleModel>>}

List all PrePack Samples [GET /packhouse/sites/{siteId}/prepack-samples]

Parameters

  • siteId number

    The Site ID

  • queryParameters PrePackSampleController.GetAllQueryParameters <optional>

    The Optional Query Parameters

Returns

  • Promise.<Array.<PrePackSampleModel>>

Source

static

getComments(siteId, id) → {Promise.<Array.<PrePackSampleController.CommentItem>>}

Retrieve Comments [GET /packhouse/sites/{siteId}/prepack-samples/{id}/comments]

Retrieves Comments for a PrePack Sample

Parameters

  • siteId number

    The Site ID

  • id string

    The PrePack Sample ID

Returns

  • Promise.<Array.<PrePackSampleController.CommentItem>>

Source

static

getOne(siteId, id) → {Promise.<PrePackSampleModel>}

Retrieve a PrePack Sample [GET /packhouse/sites/{siteId}/prepack-samples/{id}]

Parameters

  • siteId number

    The Site ID

  • id string

    The PrePack Sample ID

Returns

  • Promise.<PrePackSampleModel>

Source

static

getOneComment(siteId, id, commentId) → {Promise.<PrePackSampleController.CommentItem>}

Retrieve a Comment [GET /packhouse/sites/{siteId}/prepack-samples/{id}/comments/{commentId}]

Retrieves Comments for a PrePack Sample

Parameters

  • siteId number

    The Site ID

  • id string

    The PrePack Sample ID

  • commentId string

    The Comment ID

Returns

  • Promise.<PrePackSampleController.CommentItem>

Source

static

update(siteId, id, updateData) → {Promise.<PrePackSampleModel>}

Update a PrePack Sample [PATCH /packhouse/sites/{siteId}/prepack-samples/{id}]

Parameters

  • siteId number

    The Site ID

  • id string

    The PrePack Sample ID

  • updateData PrePackSampleController.UpdateData

    The PrePack Sample Update Data

Returns

  • Promise.<PrePackSampleModel>

Source

static

updateOneComment(siteId, id, commentId, content) → {Promise.<PrePackSampleController.CommentItem>}

Update a Comment [PATCH /packhouse/sites/{siteId}/prepack-samples/{id}/comments/{commentId}]

Update a Comment for a PrePack Sample

Parameters

  • siteId number

    The Site ID

  • id string

    The PrePack Sample ID

  • commentId string

    The Comment ID

  • content string

    The Updated Content for the Comment

Returns

  • Promise.<PrePackSampleController.CommentItem>

Source

Type Definitions

CommentItem

A CommentItem Type

Type

  • Object

Properties

  • id string

    The Comment ID

  • userAccount PrePackSampleController.UserAccount
  • content string <nullable>

    The Content of the Comment

  • createdTimestamp Date <nullable>

    When the Comment was Created

  • updatedTimestamp Date <nullable>

    When the Comment was last Updated

Source

CreateData

The Create Data for a PrePack Sample

Type

  • Object

Properties

  • packingLineId string

    The Packing Line ID this Sample is associated with

  • packrunId string <optional>

    The Packrun ID this Sample is associated with

  • createdTimestamp Date <optional>

    When this Sample was Created

  • userId string

    The ID of the User who created this Pre-Pack Sample

  • userName string

    The Name of the User who created this Pre-Pack Sample

  • sampleDefects Array.<PrePackSampleController.SampleDefect> <optional>

    An Array of Defects found in this Pre-Pack Sample

  • totalFruitSampled number <optional>

    The Total Number of Fruit Sampled in this Pre-Pack Sample

Source

GetAllQueryParameters

The Optional Query Parameters for the getAll Function

Type

  • Object

Properties

  • packingLineId string <optional>

    The Packing Line ID this Sample is associated with

  • packrunId string <optional>

    The Packrun ID this Sample is associated with

  • userId string <optional>

    The ID of the User who created this Pre-Pack Sample

  • userName string <optional>

    The Name of the User who created this Pre-Pack Sample

  • createdTimestampBegin Date <optional>

    Filter by the Timestamp when Pre-Pack Samples were Created. Results Greater than or Equal to Timestamp

  • createdTimestampEnd Date <optional>

    Filter by the Timestamp when Pre-Pack Samples were Created. Results Less than or Equal to Timestamp

  • updateTimestampBegin Date <optional>

    Filter by the Timestamp when Pre-Pack Samples were last Updated. Results Greater than or Equal to Timestamp

  • updateTimestampEnd Date <optional>

    Filter by the Timestamp when Pre-Pack Samples were last Updated. Results Less than or Equal to Timestamp

Source

UpdateData

The Update Data for a PrePack Sample

Type

  • Object

Properties

  • packingLineId string <optional>

    The Packing Line ID this Sample is associated with

  • createdTimestamp Date <optional>

    When this Sample was Created

  • userId string <optional>

    The ID of the User who created this Pre-Pack Sample

  • userName string <optional>

    The Name of the User who created this Pre-Pack Sample

  • sampleDefects Array.<PrePackSampleController.SampleDefect> <optional>

    An Array of Defects found in this Pre-Pack Sample

  • totalFruitSampled number <optional>

    The Total Number of Fruit Sampled in this Pre-Pack Sample

Source