Skip to content

Commit

Permalink
Merge pull request #1364 from sanger/y24-096-aliquot-id-renaming-avro…
Browse files Browse the repository at this point in the history
…-schema

refactor(message-builder): renamed limsUuid field to aliquotId
  • Loading branch information
seenanair authored Jul 23, 2024
2 parents 160caeb + c0899af commit 06faafb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/exchanges/volume_tracking/message_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MessageBuilder < Message::Message
# "messageUuid"=>"0a62ee15-bbf6-46f0-ba95-01d42622d076",
# "recordedAt"=>Mon, 15 Jul 2024 15:16:54.867713000 UTC +00:00,
# "volume"=>1.5, "concentration"=>10.0, "insertSize"=>100, "aliquotType"=>"primary",
# "limsUuid"=>"", "sourceType"=>"library", "sourceBarcode"=>"TRAC-2-35805",
# "aliquotId"=>"", "sourceType"=>"library", "sourceBarcode"=>"TRAC-2-35805",
# "sampleName"=>"Sample1", "usedByBarcode"=>"TRAC-2-35806", "usedByType"=>"pool"}}

def publish_data # rubocop:disable Metrics/MethodLength
Expand All @@ -20,7 +20,7 @@ def publish_data # rubocop:disable Metrics/MethodLength

aliquot = object
data = { source_type: '', source_barcode: '', sample_name: '',
used_by_type: 'nil', used_by_barcode: '', lims_uuid: aliquot.id.to_s || '' }
used_by_type: 'nil', used_by_barcode: '', aliquot_id: aliquot.id.to_s || '' }

case aliquot.source_type
when 'Pacbio::Library'
Expand Down
4 changes: 2 additions & 2 deletions config/pipelines/pacbio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ default: &default
aliquotType:
type: :model
value: aliquot_type
limsUuid:
aliquotId:
type: :self
value: publish_data&.lims_uuid
value: publish_data&.aliquot_id
sourceType:
type: :self
value: publish_data&.source_type
Expand Down
6 changes: 3 additions & 3 deletions spec/exchanges/volume_tracking/message_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sample_name: pacbio_library.sample_name,
used_by_type: 'nil',
used_by_barcode: '',
lims_uuid: aliquot.id.to_s || ''
aliquot_id: aliquot.id.to_s || ''
})
end
end
Expand All @@ -37,7 +37,7 @@
sample_name: pacbio_library.sample_name,
used_by_type: 'pool',
used_by_barcode: pacbio_pool.tube.barcode,
lims_uuid: aliquot.id.to_s || ''
aliquot_id: aliquot.id.to_s || ''
})
end
end
Expand All @@ -53,7 +53,7 @@
sample_name: pacbio_library.sample_name,
used_by_type: 'well',
used_by_barcode: "#{pacbio_well.plate.sequencing_kit_box_barcode}:#{pacbio_well.plate.plate_number}:#{pacbio_well.position}",
lims_uuid: aliquot.id.to_s || ''
aliquot_id: aliquot.id.to_s || ''
})
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/volume_tracking_avro_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"subject": "create-aliquot-in-mlwh",
"version": 1,
"id": 14,
"schema": "{\"type\":\"record\",\"name\":\"CreateAliquotInMLWH\",\"namespace\":\"uk.ac.sanger.psd\",\"doc\":\"Create an Aliquot in MLWH coming from Traction.\",\"fields\":[{\"name\":\"messageUuid\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"},\"doc\":\"Unique message ID.\"},{\"name\":\"messageCreateDateUtc\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"},\"doc\":\"Date (UTC) that the message was created.\"},{\"name\":\"limsId\",\"type\":\"string\",\"doc\":\"The LIMS system that the aliquot was created in\"},{\"name\":\"limsUuid\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"},\"doc\":\"The UUID of the aliquot in the LIMS system\"},{\"name\":\"aliquotType\",\"type\":{\"type\":\"enum\",\"name\":\"allowedAliquotType\",\"symbols\":[\"primary\",\"derived\"]},\"doc\":\"The type of the aliquot\"},{\"name\":\"sourceType\",\"type\":{\"type\":\"enum\",\"name\":\"allowedSourceType\",\"symbols\":[\"well\",\"sample\",\"library\",\"pool\"]},\"doc\":\"The type of the source of the aliquot\"},{\"name\":\"sourceBarcode\",\"type\":\"string\",\"doc\":\"The barcode of the source of the aliquot\"},{\"name\":\"sampleName\",\"type\":\"string\",\"doc\":\"The name of the sample that the aliquot was created from\"},{\"name\":\"usedByType\",\"type\":{\"type\":\"enum\",\"name\":\"allowedUsedByType\",\"symbols\":[\"library\",\"pool\",\"run\",\"none\"],\"default\":\"none\"},\"doc\":\"The type of the entity that the aliquot is used by\"},{\"name\":\"usedByBarcode\",\"type\":\"string\",\"doc\":\"The barcode of the entity that the aliquot is used by\"},{\"name\":\"volume\",\"type\":\"float\",\"doc\":\"The volume of the aliquot (uL)\"},{\"name\":\"concentration\",\"type\":[\"null\",\"float\"],\"doc\":\"The concentration of the aliquot (ng/ul)\",\"default\":null},{\"name\":\"insertSize\",\"type\":[\"null\",\"int\"],\"doc\":\"The insert size for the aliquot\",\"default\":null},{\"name\":\"recordedAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"},\"doc\":\"The date and time that the aliquot was recorded\"}]}"
"schema": "{\"type\":\"record\",\"name\":\"CreateAliquotInMLWH\",\"namespace\":\"uk.ac.sanger.psd\",\"doc\":\"Create an Aliquot in MLWH coming from Traction.\",\"fields\":[{\"name\":\"messageUuid\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"},\"doc\":\"Unique message ID.\"},{\"name\":\"messageCreateDateUtc\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"},\"doc\":\"Date (UTC) that the message was created.\"},{\"name\":\"limsId\",\"type\":\"string\",\"doc\":\"The LIMS system that the aliquot was created in\"},{\"name\":\"aliquotId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"},\"doc\":\"The UUID of the aliquot in the LIMS system\"},{\"name\":\"aliquotType\",\"type\":{\"type\":\"enum\",\"name\":\"allowedAliquotType\",\"symbols\":[\"primary\",\"derived\"]},\"doc\":\"The type of the aliquot\"},{\"name\":\"sourceType\",\"type\":{\"type\":\"enum\",\"name\":\"allowedSourceType\",\"symbols\":[\"well\",\"sample\",\"library\",\"pool\"]},\"doc\":\"The type of the source of the aliquot\"},{\"name\":\"sourceBarcode\",\"type\":\"string\",\"doc\":\"The barcode of the source of the aliquot\"},{\"name\":\"sampleName\",\"type\":\"string\",\"doc\":\"The name of the sample that the aliquot was created from\"},{\"name\":\"usedByType\",\"type\":{\"type\":\"enum\",\"name\":\"allowedUsedByType\",\"symbols\":[\"library\",\"pool\",\"run\",\"none\"],\"default\":\"none\"},\"doc\":\"The type of the entity that the aliquot is used by\"},{\"name\":\"usedByBarcode\",\"type\":\"string\",\"doc\":\"The barcode of the entity that the aliquot is used by\"},{\"name\":\"volume\",\"type\":\"float\",\"doc\":\"The volume of the aliquot (uL)\"},{\"name\":\"concentration\",\"type\":[\"null\",\"float\"],\"doc\":\"The concentration of the aliquot (ng/ul)\",\"default\":null},{\"name\":\"insertSize\",\"type\":[\"null\",\"int\"],\"doc\":\"The insert size for the aliquot\",\"default\":null},{\"name\":\"recordedAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"},\"doc\":\"The date and time that the aliquot was recorded\"}]}"
}

0 comments on commit 06faafb

Please sign in to comment.