👨💻 Technical ACs (Gherkin)
Context: A lead manifest is being processed
GIVEN
A lead manifest is being processed
Applied to: Check for Follower Manifests?
WHEN
The system checks for associated follower manifests
THEN
All linked follower manifests are identified and prepared for processing
Context: A follower manifest is identified for processing AND a lead manifest CCN exists
GIVEN
A follower manifest is identified for processing AND a lead manifest CCN exists
Applied to: Lead Manifest CCN differs from US CCN Key?
WHEN
The lead manifest CCN is compared to the current US CCN key
THEN
If the lead manifest CCN differs from the US CCN key, special action processing is initiated, otherwise standard follower processing continues
Context: A follower manifest requires processing AND the lead manifest CCN differs from US CCN AND the message type is GCW016
GIVEN
A follower manifest requires processing AND the lead manifest CCN differs from US CCN AND the message type is GCW016
Applied to: Prepare 350 Special Action Messages
WHEN
The system prepares the follower manifest message
THEN
A special action code of 350 is set in the message for proper routing and processing
Context: A follower manifest message is being prepared AND disposition codes exist for the cargo
GIVEN
A follower manifest message is being prepared AND disposition codes exist for the cargo
Applied to: Include Disposition Codes in Message
WHEN
The message content is assembled
THEN
All relevant disposition codes are included in the follower manifest message
Context: A follower manifest message is being prepared AND quantity information exists
GIVEN
A follower manifest message is being prepared AND quantity information exists
Applied to: Include Quantities in Message
WHEN
The message content is assembled
THEN
All relevant quantity information is included in the follower manifest message
Context: A follower manifest message is being prepared AND entry numbers exist
GIVEN
A follower manifest message is being prepared AND entry numbers exist
Applied to: Include Entry Numbers in Message
WHEN
The message content is assembled
THEN
All relevant entry numbers are included in the follower manifest message
Context: A follower manifest message has been prepared with all required information
GIVEN
A follower manifest message has been prepared with all required information
Applied to: Spawn GCT0162E Transaction for Follower Processing
WHEN
The system is ready to process the follower manifest
THEN
A GCT0162E transaction is spawned with the prepared message content for follower manifest processing
Context: A follower manifest is being processed AND a lead manifest exists
GIVEN
A follower manifest is being processed AND a lead manifest exists
Applied to: Link Follower to Lead Manifest
WHEN
The follower manifest processing is completed
THEN
The follower manifest is properly linked to its lead manifest for tracking and reporting purposes
Context: All follower manifests have been processed and linked to their lead manifest
GIVEN
All follower manifests have been processed and linked to their lead manifest
Applied to: Update Comprehensive Cargo Tracking
WHEN
The multi-manifest processing is completing
THEN
The comprehensive cargo tracking system is updated with all manifest relationships and cargo status information
Context: A cargo record with car ID and waybill number exists in the system
GIVEN
A cargo record with car ID and waybill number exists in the system
Applied to: Start Multi-Cargo Processing by Car/Waybill
WHEN
Multi-cargo processing is triggered for car/waybill combination
THEN
System begins coordinated processing of all related cargo records
Context: Car ID and waybill number are provided for cargo lookup
GIVEN
Car ID and waybill number are provided for cargo lookup
Applied to: Retrieve First Cargo Record by Car ID and Waybill
WHEN
System searches for cargo records with matching car ID and waybill
THEN
First matching cargo record is retrieved for processing
Context: A search for cargo records by car ID and waybill has been performed
GIVEN
A search for cargo records by car ID and waybill has been performed
Applied to: Cargo Record Found?
WHEN
System evaluates the search results
THEN
Processing continues if cargo record found, otherwise processing terminates
Context: A valid cargo record exists for processing
GIVEN
A valid cargo record exists for processing
Applied to: Process Individual Cargo Record
WHEN
Individual cargo processing is initiated
THEN
Cargo record is processed according to disposition codes and status rules
Context: A cargo record is being processed
GIVEN
A cargo record is being processed
Applied to: Analyze Cargo Hold Status
WHEN
System evaluates cargo hold status
THEN
Hold status is analyzed to determine next processing steps
Context: Cargo record contains disposition codes
GIVEN
Cargo record contains disposition codes
Applied to: Manual Release Present?
WHEN
System evaluates disposition codes for manual release
THEN
If manual release present, cargo bypasses hold checks; otherwise continue hold evaluation
Context: Cargo does not have manual release status
GIVEN
Cargo does not have manual release status
Applied to: Check Various Hold Types
WHEN
System checks for various hold types in cargo status
THEN
Hold types are identified and classified for appropriate processing
Context: Cargo status is being evaluated for holds
GIVEN
Cargo status is being evaluated for holds
Applied to: Border Hold?
WHEN
System checks for border hold indicators
THEN
If border hold exists, processing continues to release verification; otherwise check next hold type
Context: Cargo does not have border hold and status is being evaluated
GIVEN
Cargo does not have border hold and status is being evaluated
Applied to: Destination Hold?
WHEN
System checks for destination hold indicators
THEN
If destination hold exists, processing continues to release verification; otherwise check next hold type
Context: Cargo does not have border or destination hold and status is being evaluated
GIVEN
Cargo does not have border or destination hold and status is being evaluated
Applied to: FDA Hold?
WHEN
System checks for FDA hold indicators
THEN
If FDA hold exists, processing continues to release verification; otherwise check piece count hold
Context: Cargo does not have border, destination, or FDA hold and status is being evaluated
GIVEN
Cargo does not have border, destination, or FDA hold and status is being evaluated
Applied to: Piece Count Hold?
WHEN
System checks for piece count hold indicators
THEN
If piece count hold exists, processing continues to release verification; otherwise retrieve next cargo record
Context: Current cargo record processing is complete and no holds prevent continuation
GIVEN
Current cargo record processing is complete and no holds prevent continuation
Applied to: Retrieve Next Cargo Record with Same Car/Waybill
WHEN
System searches for additional cargo records with same car ID and waybill
THEN
Next matching cargo record is retrieved for processing
Context: A search for additional cargo records with same car ID and waybill has been performed
GIVEN
A search for additional cargo records with same car ID and waybill has been performed
Applied to: More Records with Same Car/Waybill?
WHEN
System evaluates search results for more records
THEN
If more records exist, continue processing; otherwise proceed to release verification
Context: All cargo records with same car ID and waybill have been processed
GIVEN
All cargo records with same car ID and waybill have been processed
Applied to: Verify Release Status Across All Records
WHEN
System verifies release status across all related records
THEN
Release status is verified for coordinated notification and database updates
Context: Release status has been verified across all related cargo records
GIVEN
Release status has been verified across all related cargo records
Applied to: All Records Released?
WHEN
System evaluates if all records are in released status
THEN
If all records released, generate comprehensive notification; otherwise generate status change notification
Context: All cargo records with same car ID and waybill are in released status
GIVEN
All cargo records with same car ID and waybill are in released status
Applied to: Generate Comprehensive Release Notification
WHEN
Comprehensive release notification is triggered
THEN
Complete release notification is generated for all stakeholders
Context: Cargo status changes have occurred during processing
GIVEN
Cargo status changes have occurred during processing
Applied to: Create Merlin Notification for Status Changes
WHEN
Merlin notification creation is triggered
THEN
Status change notifications are created and routed to appropriate recipients
Context: Cargo status changes and notifications have been processed
GIVEN
Cargo status changes and notifications have been processed
Applied to: Update Cargo Status in Database
WHEN
Database update is initiated
THEN
All cargo status changes are committed to the database
Context: All cargo records have been processed and database updates completed
GIVEN
All cargo records have been processed and database updates completed
Applied to: End Multi-Cargo Processing
WHEN
Multi-cargo processing reaches completion
THEN
Processing terminates successfully for the car/waybill group
Context: A lead manifest with an associated CCN and a current US CCN key are available
GIVEN
A lead manifest with an associated CCN and a current US CCN key are available
Applied to: Lead Manifest CCN differs from US CCN Key?
WHEN
The system compares the lead manifest CCN with the US CCN key
THEN
If the lead manifest CCN differs from the US CCN key, proceed with follower manifest processing, otherwise complete multi-manifest processing
Context: A follower manifest has been identified for processing
GIVEN
A follower manifest has been identified for processing
Applied to: Prepare Follower Manifest Data
WHEN
The system prepares follower manifest data
THEN
All required manifest data elements including cargo information, quantities, and entry numbers are prepared for message creation
Context: A follower manifest requires processing and the message type is GCW016
GIVEN
A follower manifest requires processing and the message type is GCW016
Applied to: Create 350 Special Action Message
WHEN
The system creates a special action message
THEN
A message with special action code 350 is created and general information is copied for the follower manifest
Context: A follower manifest message is being prepared and disposition codes exist
GIVEN
A follower manifest message is being prepared and disposition codes exist
Applied to: Include Disposition Codes in Message
WHEN
The system includes disposition codes in the message
THEN
All relevant disposition codes are included in the follower manifest message for downstream processing
Context: A follower manifest message is being prepared and cargo quantities are available
GIVEN
A follower manifest message is being prepared and cargo quantities are available
Applied to: Include Cargo Quantities in Message
WHEN
The system includes cargo quantities in the message
THEN
All relevant cargo quantities are included in the follower manifest message
Context: A follower manifest message is being prepared and entry numbers exist
GIVEN
A follower manifest message is being prepared and entry numbers exist
Applied to: Include Entry Numbers in Message
WHEN
The system includes entry numbers in the message
THEN
All relevant entry numbers are included in the follower manifest message
Context: A follower manifest message has been prepared with all required data
GIVEN
A follower manifest message has been prepared with all required data
Applied to: Spawn GCT0162E Transaction for Follower Processing
WHEN
The system spawns the GCT0162E transaction
THEN
The GCT0162E transaction is initiated with the prepared follower manifest message for processing
Context: A follower manifest and its corresponding lead manifest are identified
GIVEN
A follower manifest and its corresponding lead manifest are identified
Applied to: Link Follower Manifest to Lead Manifest
WHEN
The system links the follower manifest to the lead manifest
THEN
The relationship between the follower and lead manifest is established for comprehensive tracking
Context: A follower manifest has been processed and linked to its lead manifest
GIVEN
A follower manifest has been processed and linked to its lead manifest
Applied to: Update Comprehensive Cargo Tracking
WHEN
The system updates comprehensive cargo tracking
THEN
The cargo tracking system is updated with complete follower manifest information for full visibility
Context: A follower manifest processing action has been completed
GIVEN
A follower manifest processing action has been completed
Applied to: Log Follower Manifest Processing Action
WHEN
The system logs the processing action
THEN
The follower manifest processing action is recorded in the system log for audit and monitoring purposes
Context: One follower manifest has been processed and there may be additional follower manifests
GIVEN
One follower manifest has been processed and there may be additional follower manifests
Applied to: More Follower Manifests?
WHEN
The system checks for more follower manifests to process
THEN
If more follower manifests exist, continue processing the next one, otherwise complete multi-manifest processing
Context: A car ID and waybill number combination exists from previous N7 segment processing
GIVEN
A car ID and waybill number combination exists from previous N7 segment processing
Applied to: Retrieve First Cargo Record by Car ID and Waybill
WHEN
The system needs to process multiple cargo records with the same car and waybill
THEN
The system retrieves the first cargo record matching the car ID and waybill combination from the US cargo root segments
Context: A search has been performed for cargo records by car ID and waybill
GIVEN
A search has been performed for cargo records by car ID and waybill
Applied to: Cargo Record Found?
WHEN
The system evaluates the search results
THEN
If a cargo record is found, continue with individual cargo processing, otherwise end the multi-cargo processing
Context: A cargo record has been retrieved with matching car ID and waybill
GIVEN
A cargo record has been retrieved with matching car ID and waybill
Applied to: Process Individual Cargo Record
WHEN
The system processes the individual cargo record
THEN
The system applies the current disposition code processing logic to the cargo record
Context: An individual cargo record is being processed with current disposition code context
GIVEN
An individual cargo record is being processed with current disposition code context
Applied to: Update Cargo Status and Disposition Codes
WHEN
The system updates the cargo record
THEN
The system applies the disposition code to the cargo's status array and updates the cargo status according to disposition code processing rules
Context: One cargo record has been processed for a car ID and waybill combination
GIVEN
One cargo record has been processed for a car ID and waybill combination
Applied to: Check for Additional Cargo Records with Same Car/Waybill
WHEN
The system checks for additional records
THEN
The system searches the cargo database for other records with the same car ID and waybill combination
Context: A search has been performed for additional cargo records with the same car ID and waybill
GIVEN
A search has been performed for additional cargo records with the same car ID and waybill
Applied to: More Records with Same Car/Waybill?
WHEN
The system evaluates the search results
THEN
If more records are found, retrieve the next record for processing, otherwise proceed to release status verification
Context: Additional cargo records exist with the same car ID and waybill combination
GIVEN
Additional cargo records exist with the same car ID and waybill combination
Applied to: Retrieve Next Cargo Record
WHEN
The system retrieves the next record
THEN
The system fetches the next cargo record from the US cargo root segments for processing
Context: All cargo records with the same car ID and waybill have been processed
GIVEN
All cargo records with the same car ID and waybill have been processed
Applied to: Verify Release Status Across All Records
WHEN
The system verifies release status across all records
THEN
The system examines the release status of each processed cargo record to determine overall release state
Context: Release status has been verified across all cargo records with the same car ID and waybill
GIVEN
Release status has been verified across all cargo records with the same car ID and waybill
Applied to: All Records Have Same Release Status?
WHEN
The system evaluates status consistency
THEN
If all records have the same release status, generate comprehensive release notification, otherwise proceed to create Merlin notifications for status changes
Context: All cargo records with the same car ID and waybill have consistent release status
GIVEN
All cargo records with the same car ID and waybill have consistent release status
Applied to: Generate Comprehensive Release Notification
WHEN
The system generates release notification
THEN
The system creates a comprehensive release notification covering all related cargo records
Context: Cargo records have been processed and comprehensive release notification generated
GIVEN
Cargo records have been processed and comprehensive release notification generated
Applied to: Generate Export Notification if Applicable
WHEN
The system evaluates export notification requirements
THEN
If any cargo records have export status or export-related disposition codes, generate appropriate export notifications
Context: Export notifications have been processed for applicable cargo records
GIVEN
Export notifications have been processed for applicable cargo records
Applied to: Generate Arrival Notification if Applicable
WHEN
The system evaluates arrival notification requirements
THEN
If any cargo records have arrival status or arrival-related disposition codes, generate appropriate arrival notifications
Context: Cargo records with the same car ID and waybill do not have consistent release status OR arrival notifications have been processed
GIVEN
Cargo records with the same car ID and waybill do not have consistent release status OR arrival notifications have been processed
Applied to: Create Merlin Notification for Status Changes
WHEN
The system creates Merlin notifications
THEN
The system generates appropriate Merlin messages for each cargo status change including disposition code details and cargo information
Context: All notifications have been generated for cargo records with the same car ID and waybill
GIVEN
All notifications have been generated for cargo records with the same car ID and waybill
Applied to: Update Final Status for All Related Records
WHEN
The system updates final status
THEN
The system commits all status changes and disposition code updates to all related cargo records in the database
Context: A cargo record requires multi-cargo status verification
GIVEN
A cargo record requires multi-cargo status verification
Applied to: Start Multi-Cargo Status Verification
WHEN
The multi-cargo status verification process is initiated
THEN
The verification process begins and prepares to retrieve related cargo records
Context: A car ID and waybill number are provided for verification
GIVEN
A car ID and waybill number are provided for verification
Applied to: Retrieve All Cargo Records with Same Car ID and Waybill
WHEN
The system searches for related cargo records
THEN
All cargo records with matching car ID and waybill number are retrieved from the cargo database
Context: A search for cargo records with matching car ID and waybill has been performed
GIVEN
A search for cargo records with matching car ID and waybill has been performed
Applied to: More Records Found?
WHEN
The system checks for additional unprocessed records
THEN
If more records exist, continue processing individual records, otherwise proceed to status comparison
Context: An individual cargo record is selected for processing
GIVEN
An individual cargo record is selected for processing
Applied to: Process Individual Cargo Record
WHEN
The record processing begins
THEN
The cargo record is prepared for hold status analysis
Context: A cargo record is being processed for status verification
GIVEN
A cargo record is being processed for status verification
Applied to: Analyze Cargo Hold Status
WHEN
The hold status analysis is performed
THEN
The system evaluates all hold conditions and release status for the cargo
Context: A cargo record is being analyzed for release status
GIVEN
A cargo record is being analyzed for release status
Applied to: Check Manual Release Status
WHEN
The system checks for manual release indicators
THEN
If manual release is found, skip other hold checks and mark as released, otherwise continue with hold type evaluation
Context: A cargo record without manual release is being processed
GIVEN
A cargo record without manual release is being processed
Applied to: Check Various Hold Types
WHEN
Hold type evaluation begins
THEN
The system proceeds to check border holds, destination holds, FDA holds, and piece count holds
Context: A cargo record is being evaluated for hold conditions
GIVEN
A cargo record is being evaluated for hold conditions
Applied to: Evaluate Border Hold
WHEN
Border hold status is checked
THEN
The system determines if border hold conditions apply to the cargo
Applied to: Evaluate Destination Hold
WHEN
Destination hold status is checked
THEN
The system determines if destination hold conditions apply to the cargo
Applied to: Evaluate FDA Hold
WHEN
FDA hold status is checked
THEN
The system determines if FDA hold conditions apply to the cargo
Applied to: Evaluate Piece Count Hold
WHEN
Piece count hold status is checked
THEN
The system determines if piece count hold conditions apply based on quantity validation
Context: All hold conditions have been evaluated for a cargo record
GIVEN
All hold conditions have been evaluated for a cargo record
Applied to: Determine Individual Record Release Status
WHEN
The final release status is determined
THEN
The cargo record is classified as either released or held based on the evaluation results
Context: An individual cargo record's release status has been determined
GIVEN
An individual cargo record's release status has been determined
Applied to: Store Record Status in Verification Array
WHEN
The status is stored in the verification array
THEN
The record's release status is added to the array for later comparison with other related records
Context: All related cargo records have been processed and their statuses stored
GIVEN
All related cargo records have been processed and their statuses stored
Applied to: Compare All Record Statuses
WHEN
Status comparison is performed
THEN
The system compares all record statuses to determine if they are consistent
Context: All related cargo record statuses have been compared
GIVEN
All related cargo record statuses have been compared
Applied to: All Records Have Consistent Release Status?
WHEN
Consistency verification is performed
THEN
If all records have consistent release status, generate comprehensive release notification, otherwise create status mismatch warning
Context: All related cargo records have consistent release status
GIVEN
All related cargo records have consistent release status
Applied to: Generate Comprehensive Release Notification
WHEN
Comprehensive release notification is generated
THEN
A notification is created confirming the consistent release status across all related records
Context: Related cargo records have inconsistent release statuses
GIVEN
Related cargo records have inconsistent release statuses
Applied to: Create Release Status Mismatch Warning
WHEN
Status mismatch warning is created
THEN
A warning is generated indicating the inconsistency in release statuses among related records
Context: Multi-cargo status verification has been completed
GIVEN
Multi-cargo status verification has been completed
Applied to: Update Multi-Cargo Release Flag
WHEN
The multi-cargo release flag is updated
THEN
The flag is set to reflect the overall release status of all related cargo records
Applied to: Log Status Verification Results
WHEN
Results logging is performed
THEN
The verification results, including any warnings or notifications, are logged for audit purposes
Context: All multi-cargo status verification activities have been completed
GIVEN
All multi-cargo status verification activities have been completed
Applied to: End Multi-Cargo Status Verification
WHEN
The verification process ends
THEN
The process is completed and control is returned to the calling procedure