Class: Api::V2::VolumeUpdateResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::VolumeUpdateResource
- Defined in:
- app/resources/api/v2/volume_update_resource.rb
Overview
Access this resource via the /api/v2/volume_updates/ endpoint.
Updates are not allowed on this resource @see self.updatable_fields
Provides a JSON:API representation of VolumeUpdate for the tracking of volume changes associated with labware.
Performs a change of volume on a resource Primarily created on plates via Assets Audits application to indicate reduced volume on, eg. working dilution creation. No records exist on 29/05/2019 due to no volumes configured for processes
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.
Instance Attribute Summary collapse
-
#created_by ⇒ String
The user who created the volume update.
-
#target_uuid ⇒ String
Transforms the target Labware into its UUID when generating an API query response.
-
#volume_change ⇒ Float
The amount of volume change that occurred on the target labware.
Class Method Summary collapse
-
.updatable_fields(_context) ⇒ Array<Symbol>
Gets the list of fields which are updatable on an existing VolumeUpdate.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations
Instance Attribute Details
#created_by ⇒ String
This can be any string, update to use a user relationship
See Y25-236.
This attribute is required.
The user who created the volume update.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'app/resources/api/v2/volume_update_resource.rb', line 50 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |
#target_uuid ⇒ String
Transforms the target Labware into its UUID when generating an API query response.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'app/resources/api/v2/volume_update_resource.rb', line 56 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |
#volume_change ⇒ Float
This attribute is required.
The amount of volume change that occurred on the target labware.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'app/resources/api/v2/volume_update_resource.rb', line 62 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |
Class Method Details
.updatable_fields(_context) ⇒ Array<Symbol>
Use except: %i[update] in routes.rb or the access restrictions instead of this approach
See Y25-236.
Gets the list of fields which are updatable on an existing VolumeUpdate.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'app/resources/api/v2/volume_update_resource.rb', line 93 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |