Class: Api::V2::LotResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::LotResource
- Defined in:
- app/resources/api/v2/lot_resource.rb
Overview
Access this resource via the /api/v2/lots/
endpoint.
This resource supports retrieval and creation of lots but does not allow modification after creation.
The below POST example is not currently supported by the API, but is included here for reference.
Provides a JSON:API representation of Lot.
A Lot
represents a received batch of consumables (eg. tag plates) that can be assumed to share some level of QC. A lot can be generated from Gatekeeper.
This is because received_at
is a required field in the model, but is not included in the JSON:API request.
For more information about JSON:API, see the JSON:API Specifications or the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.
Instance Attribute Summary collapse
-
#lot_number ⇒ String
The lot number.
-
#lot_type ⇒ LotTypeResource
The type of lot, which governs the behaviour of a Lot.
-
#tag_layout_template ⇒ TagLayoutTemplateResource
readonly
A tag layout template associated with this lot, used for specific processing workflows.
-
#template ⇒ TemplateResource
The template associated with this lot, which may vary depending on the lot type.
-
#user ⇒ UserResource
The user who created or registered this lot.
-
#uuid ⇒ String
readonly
The universally unique identifier (UUID) of the lot.
Instance Method Summary collapse
-
#tag_layout_template_id ⇒ String?
Retrieves the template ID for the associated tag layout template.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#lot_number ⇒ String
This field is required when creating a lot.
Returns The lot number.
69 |
# File 'app/resources/api/v2/lot_resource.rb', line 69 attribute :lot_number, write_once: true |
#lot_type ⇒ LotTypeResource
This relationship is required when creating a lot.
The type of lot, which governs the behaviour of a Lot.
79 |
# File 'app/resources/api/v2/lot_resource.rb', line 79 has_one :lot_type |
#tag_layout_template ⇒ TagLayoutTemplateResource (readonly)
This relationship is loaded only when explicitly included.
A tag layout template associated with this lot, used for specific processing workflows.
98 |
# File 'app/resources/api/v2/lot_resource.rb', line 98 has_one :tag_layout_template, eager_load_on_include: false |
#template ⇒ TemplateResource
This relationship is required when creating a lot.
The template associated with this lot, which may vary depending on the lot type. This is a polymorphic relationship, meaning it can be linked to different types of templates.
92 |
# File 'app/resources/api/v2/lot_resource.rb', line 92 has_one :template, polymorphic: true |
#user ⇒ UserResource
This relationship is required when creating a lot.
The user who created or registered this lot.
85 |
# File 'app/resources/api/v2/lot_resource.rb', line 85 has_one :user |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
Returns The universally unique identifier (UUID) of the lot.
64 |
# File 'app/resources/api/v2/lot_resource.rb', line 64 attribute :uuid, readonly: true |
Instance Method Details
#tag_layout_template_id ⇒ String?
Retrieves the template ID for the associated tag layout template.
107 108 109 |
# File 'app/resources/api/v2/lot_resource.rb', line 107 def tag_layout_template_id template_id end |