Class: Api::V2::TransferRequestResource

Inherits:
BaseResource
  • Object
show all
Defined in:
app/resources/api/v2/transfer_request_resource.rb

Overview

Note:

This resource is immutable: its endpoint will not accept POST, PATCH, or DELETE requests.

Note:

Access this resource via the /api/v2/transfer_requests/ endpoint.

Provides a JSON:API representation of TransferRequest.

A TransferRequest represents a request for transferring (“moving”) a resource (asset) from one location to another without really transforming it (chemically) as, cherrypicking, pooling, spreading on the floor etc

For more information about JSON:API see the JSON:API Specifications or look at the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.

Examples:

GET request for all TransferRequest resources

GET /api/v2/transfer_requests/

GET request for a TransferRequest with ID 123

GET /api/v2/transfer_requests/123/

Instance Attribute Summary collapse

Method Summary

Methods inherited from BaseResource

apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields

Instance Attribute Details

#source_assetReceptacleResource (readonly)

The source asset (or receptacle) from which the material is being transferred.

Returns:



56
# File 'app/resources/api/v2/transfer_request_resource.rb', line 56

has_one :source_asset, relation_name: 'asset', foreign_key: :asset_id, class_name: 'Receptacle', readonly: true

#stateString (readonly)

The current state of the transfer request, indicating its processing status (e.g., pending, completed).

Returns:

  • (String)

    The state of the transfer request.



41
# File 'app/resources/api/v2/transfer_request_resource.rb', line 41

attribute :state, readonly: true

#submissionSubmissionResource (readonly)

The submission associated with this transfer request, which provides context for the transfer.

Returns:



61
# File 'app/resources/api/v2/transfer_request_resource.rb', line 61

has_one :submission, foreign_key: :submission_id, class_name: 'Submission', readonly: true

#target_assetReceptacleResource (readonly)

The target asset (or receptacle) to which the material is being transferred.

Returns:



66
# File 'app/resources/api/v2/transfer_request_resource.rb', line 66

has_one :target_asset, foreign_key: :target_asset_id, class_name: 'Receptacle', readonly: true

#uuidString (readonly)

The unique identifier of the transfer request.

Returns:

  • (String)

    The UUID of the transfer request.



36
# File 'app/resources/api/v2/transfer_request_resource.rb', line 36

attribute :uuid, readonly: true

#volumeInteger (readonly)

The volume associated with the transfer request. This could represent the quantity of material to be transferred.

Returns:

  • (Integer)

    The volume of the transfer request.



47
# File 'app/resources/api/v2/transfer_request_resource.rb', line 47

attribute :volume, readonly: true