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.
-
#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.
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.
78 |
# File 'app/resources/api/v2/lot_resource.rb', line 78 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.
97 |
# File 'app/resources/api/v2/lot_resource.rb', line 97 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.
91 |
# File 'app/resources/api/v2/lot_resource.rb', line 91 has_one :template, polymorphic: true |
#user ⇒ UserResource
This relationship is required when creating a lot.
The user who created or registered this lot.
84 |
# File 'app/resources/api/v2/lot_resource.rb', line 84 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.
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 |