Skip to content

[LIMS-2005] Perform manufacturer serial number check when creating dewars#26

Merged
gfrn merged 1 commit intomasterfrom
feature/lims-2005/msn-check
Jan 16, 2026
Merged

[LIMS-2005] Perform manufacturer serial number check when creating dewars#26
gfrn merged 1 commit intomasterfrom
feature/lims-2005/msn-check

Conversation

@gfrn
Copy link
Collaborator

@gfrn gfrn commented Jan 13, 2026

JIRA ticket: LIMS-2005

Summary:

To prevent users from accidentally submitting the wrong dewar, it was suggested by eBIC personnel to ask them to submit a MSN, which would be checked against the DewarRegistry table to ensure the correct MSN is used with the corresponding dewar code.

Changes:

  • Perform manufacturer serial number check when creating dewars

To test:

To give one of the dewars in one of the existing shipments a manufacturer serial number, run the following in restored ISPyB:

UPDATE ispyb.DewarRegistry
	SET manufacturerSerialNumber='bar'
	WHERE dewarRegistryId=1130;
  • Send a POST to /shipments/{shipmentId}/topLevelContainers, with the following body, expect 404 to be returned:
{
      "type": "dewar",
      "code": "DLS-BI-9966",
      "manufacturerSerialNumber": "serial123",
}
  • Change the manufacturer serial number to bar (or whatever you set it as), 201 should be returned
  • Set the code to null and the manufacturer serial number to new-code-123, check if a new dewar registry entry is created with new-code-123 as the manufacturer serial number

@gfrn gfrn self-assigned this Jan 13, 2026
@gfrn gfrn added the enhancement New feature or request label Jan 13, 2026
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.68%. Comparing base (9cf6aa8) to head (3a15676).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   94.67%   94.68%   +0.01%     
==========================================
  Files          42       42              
  Lines        1745     1751       +6     
==========================================
+ Hits         1652     1658       +6     
  Misses         93       93              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

registry_json: dict[str, Any] = code_response.json()
msn = registry_json.get("manufacturerSerialNumber")
if isinstance(params, TopLevelContainerIn) and msn is not None:
app_logger.error(f"{msn}, {params.manufacturerSerialNumber}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a debug message?

@gfrn gfrn merged commit 54dd01a into master Jan 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants