Skip to content

Commit 06faafb

Browse files
authored
Merge pull request #1364 from sanger/y24-096-aliquot-id-renaming-avro-schema
refactor(message-builder): renamed limsUuid field to aliquotId
2 parents 160caeb + c0899af commit 06faafb

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

app/exchanges/volume_tracking/message_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class MessageBuilder < Message::Message
1111
# "messageUuid"=>"0a62ee15-bbf6-46f0-ba95-01d42622d076",
1212
# "recordedAt"=>Mon, 15 Jul 2024 15:16:54.867713000 UTC +00:00,
1313
# "volume"=>1.5, "concentration"=>10.0, "insertSize"=>100, "aliquotType"=>"primary",
14-
# "limsUuid"=>"", "sourceType"=>"library", "sourceBarcode"=>"TRAC-2-35805",
14+
# "aliquotId"=>"", "sourceType"=>"library", "sourceBarcode"=>"TRAC-2-35805",
1515
# "sampleName"=>"Sample1", "usedByBarcode"=>"TRAC-2-35806", "usedByType"=>"pool"}}
1616

1717
def publish_data # rubocop:disable Metrics/MethodLength
@@ -20,7 +20,7 @@ def publish_data # rubocop:disable Metrics/MethodLength
2020

2121
aliquot = object
2222
data = { source_type: '', source_barcode: '', sample_name: '',
23-
used_by_type: 'nil', used_by_barcode: '', lims_uuid: aliquot.id.to_s || '' }
23+
used_by_type: 'nil', used_by_barcode: '', aliquot_id: aliquot.id.to_s || '' }
2424

2525
case aliquot.source_type
2626
when 'Pacbio::Library'

config/pipelines/pacbio.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ default: &default
333333
aliquotType:
334334
type: :model
335335
value: aliquot_type
336-
limsUuid:
336+
aliquotId:
337337
type: :self
338-
value: publish_data&.lims_uuid
338+
value: publish_data&.aliquot_id
339339
sourceType:
340340
type: :self
341341
value: publish_data&.source_type

spec/exchanges/volume_tracking/message_builder_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
sample_name: pacbio_library.sample_name,
2222
used_by_type: 'nil',
2323
used_by_barcode: '',
24-
lims_uuid: aliquot.id.to_s || ''
24+
aliquot_id: aliquot.id.to_s || ''
2525
})
2626
end
2727
end
@@ -37,7 +37,7 @@
3737
sample_name: pacbio_library.sample_name,
3838
used_by_type: 'pool',
3939
used_by_barcode: pacbio_pool.tube.barcode,
40-
lims_uuid: aliquot.id.to_s || ''
40+
aliquot_id: aliquot.id.to_s || ''
4141
})
4242
end
4343
end
@@ -53,7 +53,7 @@
5353
sample_name: pacbio_library.sample_name,
5454
used_by_type: 'well',
5555
used_by_barcode: "#{pacbio_well.plate.sequencing_kit_box_barcode}:#{pacbio_well.plate.plate_number}:#{pacbio_well.position}",
56-
lims_uuid: aliquot.id.to_s || ''
56+
aliquot_id: aliquot.id.to_s || ''
5757
})
5858
end
5959
end

spec/fixtures/volume_tracking_avro_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"subject": "create-aliquot-in-mlwh",
33
"version": 1,
44
"id": 14,
5-
"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\"}]}"
5+
"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\"}]}"
66
}

0 commit comments

Comments
 (0)