Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPL-960- Bioscan input plate state changes #3967

Merged
merged 10 commits into from
Dec 6, 2023
33 changes: 33 additions & 0 deletions app/models/plate_purpose/input_started.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

# Input Plate purposes are the initial stock plates passing into
# external piplines. They have special behaviour governing their state.
# This essentially makes sure that all non-empty wells on a plate have requests
# out of them. This is intended to ensure that submissions have been
# correctly built before a plate has processed.
#
# - Input plates are progressed when all sample containing wells have requests out of them
#
# This version of the input class sets the state as started rather than passed.
class PlatePurpose::InputStarted < PlatePurpose::Input
READY_STATE = 'started'

private

# TODO: for some reason this private method needs to be here despite being a copy of
andrewsparkes marked this conversation as resolved.
Show resolved Hide resolved
# the parent class method, otherwise the READY_STATE constant above isn't used over the
# one in the parent class.
def calculate_state_of_plate(wells_states)
andrewsparkes marked this conversation as resolved.
Show resolved Hide resolved
andrewsparkes marked this conversation as resolved.
Show resolved Hide resolved
andrewsparkes marked this conversation as resolved.
Show resolved Hide resolved
unique_states = wells_states.uniq
return UNREADY_STATE if unique_states.include?(:unready)

case unique_states.sort
when ['failed'], %w[cancelled failed]
'failed'
when ['cancelled']
'cancelled'
else
READY_STATE
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# This is the insects in ethanol plate for the start of the Lysate pipeline
# It is the original source plate that has come in from the suppliers around the UK.
LILYS-96 Stock:
type: PlatePurpose::Input
type: PlatePurpose::InputStarted
stock_plate: true
cherrypickable_target: false
# This is the lysed material plate, ready for the Library prep pipeline. These plates
Expand Down
Loading