Skip to content

feat: include detailed shipment and instrument data from questionary#1330

Merged
yoganandaness merged 5 commits intodevelopfrom
SWAP-5211-uo-sync-sample-and-proposal-information-to-eam-du
Feb 4, 2026
Merged

feat: include detailed shipment and instrument data from questionary#1330
yoganandaness merged 5 commits intodevelopfrom
SWAP-5211-uo-sync-sample-and-proposal-information-to-eam-du

Conversation

@yoganandaness
Copy link
Contributor

@yoganandaness yoganandaness commented Feb 2, 2026

Description

This pull request significantly enhances the process of creating asset equipment containers for EAM by extracting and including detailed shipment, sender, and instrument information in the request payload. It introduces a helper function to fetch answers from questionaries, expands the data sent to EAM, and adds a comprehensive test for the request payload structure.

Motivation and Context

Feature Expansion & Data Collection

How Has This Been Tested

Added a new test (AddAssetEquipment.spec.ts) to verify that the generated payload includes all required fields and matches the expected structure, improving confidence in the integration.…in the EAM asset creation payload.

Fixes

Changes

Feature Expansion & Data Collection:

  • Added a getAnswer helper function to retrieve specific answers from questionaries, supporting different data types and handling optional/required fields. This enables dynamic extraction of shipment and sender details.
  • Updated createContainer to collect additional data (weight, dimensions, dangerous goods details, sender information, parcel value, associated instruments, etc.) from the shipment's questionary and the instrument data source. [1] [2]

Request Payload & Integration:

  • Modified getAddAssetEquipmentRequestPayload to accept and include the new fields, mapping them to the appropriate EAM custom fields (USERDEFINEDAREA.CUSTOMFIELD). This ensures all relevant shipment and sender data are transmitted to EAM. [1] [2]

Depends on

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@yoganandaness yoganandaness requested a review from a team as a code owner February 2, 2026 13:16
@yoganandaness yoganandaness requested review from Bhaswati1148, jekabs-karklins and simonfernandes and removed request for a team February 2, 2026 13:16
@yoganandaness yoganandaness removed the request for review from Bhaswati1148 February 2, 2026 13:17
@yoganandaness yoganandaness changed the title feat: Include detailed shipment and instrument data from questionary … feat: include detailed shipment and instrument data from questionary Feb 2, 2026
Copy link
Contributor

@jekabs-karklins jekabs-karklins left a comment

Choose a reason for hiding this comment

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

Looks very good 👍🏻

@yoganandaness yoganandaness force-pushed the SWAP-5211-uo-sync-sample-and-proposal-information-to-eam-du branch from 09ffc0d to b20ebe6 Compare February 3, 2026 14:53
sample_id: sampleId,
}))
);
if (sampleIds.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a small thing: it looks like the mutation would prevent an empty list, so is this check redundant? Or if it is still needed, should there be an earlier return from this function so that data isn't deleted from shipments_has_samples first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@simonfernandes Valuable point that. It is absolutely redundant and does not make sense to have a business check in the datasource layer. I have removed that and now the check only stays in the business layer(Mutation).

@yoganandaness yoganandaness enabled auto-merge (squash) February 4, 2026 10:30
@yoganandaness yoganandaness merged commit 8993574 into develop Feb 4, 2026
36 of 37 checks passed
@yoganandaness yoganandaness deleted the SWAP-5211-uo-sync-sample-and-proposal-information-to-eam-du branch February 4, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants