Class: Api::V2::LotResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::LotResource
- Defined in:
- app/resources/api/v2/lot_resource.rb
Overview
The below POST example is not currently supported by the API, but is included here for reference. This is because received_at
is a required field in the model, but is not included in the resource. See Y25-236.
Access this resource via the /api/v2/lots/
endpoint.
This resource supports retrieval and creation of lots but does not allow modification after creation.
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.
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.
-
#lot_type_name ⇒ String?
readonly
Retrieves the name of the lot type associated with this 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.
-
#template_name ⇒ String?
readonly
Retrieves the name of the template associated with this lot.
-
#user ⇒ UserResource
The user who created or registered this lot.
-
#uuid ⇒ Object
readonly
A filter to return only lots with the given UUID.
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.
68 |
# File 'app/resources/api/v2/lot_resource.rb', line 68 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.
118 |
# File 'app/resources/api/v2/lot_resource.rb', line 118 has_one :lot_type |
#lot_type_name ⇒ String? (readonly)
Retrieves the name of the lot type associated with this lot.
e.g. 'Pre Stamped Tags'
72 |
# File 'app/resources/api/v2/lot_resource.rb', line 72 attribute :lot_type_name, readonly: true |
#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. This represents the same entity as template
above, but is only relevant when template_type is TagLayoutTemplate
.
140 |
# File 'app/resources/api/v2/lot_resource.rb', line 140 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 entity types (TagLayoutTemplate, Tag2LayoutTemplate and Labware/PlateTemplate at time of writing).
132 |
# File 'app/resources/api/v2/lot_resource.rb', line 132 has_one :template, polymorphic: true |
#template_name ⇒ String? (readonly)
Retrieves the name of the template associated with this lot. See template association below for more details.
e.g. 'TSsc384-PCR2-nCoV-2019/V3/B'
76 |
# File 'app/resources/api/v2/lot_resource.rb', line 76 attribute :template_name, readonly: true |
#user ⇒ UserResource
This relationship is required when creating a lot.
The user who created or registered this lot.
124 |
# File 'app/resources/api/v2/lot_resource.rb', line 124 has_one :user |
#uuid ⇒ Object (readonly)
A filter to return only lots with the given UUID.
63 |
# File 'app/resources/api/v2/lot_resource.rb', line 63 attribute :uuid, readonly: true |
Instance Method Details
#tag_layout_template_id ⇒ String?
Retrieves the template ID for the associated tag layout template.
106 107 108 |
# File 'app/resources/api/v2/lot_resource.rb', line 106 def tag_layout_template_id template_id end |