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

LIMS-59: Never write null to DewarTransportHistory.storageLocation #597

Conversation

ndg63276
Copy link
Collaborator

Ticket: LIMS-59

  • DewarTransportHistory.storageLocation should not be nullable in the schema
  • Write the dewar location as "off-site" when creating an AWB, booking a pickup or marking as sent
  • Write the dewar location as the current location when cancelling a pickup, in case dewar has moved in the meantime
  • Do the same for the dewar history

Copy link
Contributor

@John-Holt-Tessella John-Holt-Tessella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are several other places that this value could be null. Would it be wise to add a single function for adding dewar history? Maybe by using the updateDewarHistory funtion in assign data? Although it is a bit of a weird name for it. Feels like it would be better in a dewarData function?

api/src/Model/Services/AssignData.php Show resolved Hide resolved
api/src/Page/Shipment.php Show resolved Hide resolved
@@ -3090,7 +3090,7 @@ function _cancel_pickup()
$this->_error('No such lab contact');
$cont = $cont[0];

$dewars = $this->db->pq("SELECT d.dewarid
$dewars = $this->db->pq("SELECT d.dewarid, d.storagelocation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could the dewar storage location not be null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a check for null on line 3116

@ndg63276
Copy link
Collaborator Author

ndg63276 commented Sep 4, 2023

Refactoring into a single function is probably a good idea, but maybe that should be a new ticket. Hopefully have resolved the issues with any insert into DTH statements.

Copy link
Contributor

@John-Holt-Tessella John-Holt-Tessella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests don't pass

@ndg63276
Copy link
Collaborator Author

Tests don't pass

Tests now pass :)

@John-Holt-Tessella John-Holt-Tessella merged commit b8aeda5 into prerelease Oct 12, 2023
2 checks passed
@John-Holt-Tessella John-Holt-Tessella deleted the fix/LIMS-59/never-write-null-to-DTH-storageLocation branch October 12, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants