👨💻 Technical ACs (Gherkin)
Context: A manifest record is being processed
GIVEN
A manifest record is being processed
Applied to: Lead Manifest Identified
WHEN
The manifest CCN key matches the saved CCN from previous processing
THEN
The system identifies this as a lead manifest requiring follower processing
Applied to: Is Lead Manifest?
WHEN
The system evaluates the manifest type
THEN
The system identifies whether it is a lead manifest with associated followers or a single manifest
Context: A lead manifest has been identified
GIVEN
A lead manifest has been identified
Applied to: Follower Manifests Exist?
WHEN
The system checks for associated follower manifests
THEN
The system sets follower end-of-database flag based on whether follower records are found
Applied to: Get Follower Manifest List
WHEN
The system needs to process associated follower manifests
THEN
The system retrieves the complete list of follower manifests from GCWTL-TRAIN-LIST
Context: Follower manifests exist for the lead manifest
GIVEN
Follower manifests exist for the lead manifest
Applied to: Retrieve Follower Manifest List
WHEN
The system initiates follower manifest retrieval
THEN
The system calls GCT0161E to retrieve all follower manifest records
Context: A list of follower manifests has been retrieved
GIVEN
A list of follower manifests has been retrieved
Applied to: Select Next Follower Manifest
WHEN
The system needs to process the next follower manifest
THEN
The system selects the next available follower manifest record from the list
Applied to: More Followers Available?
WHEN
The system is iterating through the follower manifest list
THEN
The system determines if more follower manifests are available for processing or if all have been processed
Context: A follower manifest has been selected for processing
GIVEN
A follower manifest has been selected for processing
Applied to: Prepare EDI 350 Message for Follower
WHEN
The system prepares the EDI message for the follower
THEN
The system sets special action code '350' and copies disposition code, quantity, and entry number from X4 segment
Applied to: Format EDI 350 Message for Follower
WHEN
The system needs to create an EDI message for the follower
THEN
The system formats an EDI 350 message with follower-specific data and parameters
Context: An EDI 350 message has been prepared for a follower manifest
GIVEN
An EDI 350 message has been prepared for a follower manifest
Applied to: Format Message with Follower Details
WHEN
The system formats the message with follower details
THEN
The system includes follower manifest CCN, cargo details, and processing instructions in the formatted message
Context: A follower message has been formatted with all required details
GIVEN
A follower message has been formatted with all required details
Applied to: Spawn GCT0161E Transaction for Follower
WHEN
The system initiates follower processing
THEN
The system spawns GCT0161E transaction with the formatted follower message for independent processing
Context: A follower manifest has been processed and GCT0161E transaction spawned
GIVEN
A follower manifest has been processed and GCT0161E transaction spawned
Applied to: More Followers to Process?
WHEN
The system checks for remaining follower manifests
THEN
The system evaluates the follower end-of-database flag to determine if more followers exist
Context: All follower manifests have been processed and transactions spawned
GIVEN
All follower manifests have been processed and transactions spawned
Applied to: All Follower Manifests Processed
WHEN
No more follower manifests remain in the list
THEN
The system sets completion status and prepares to continue with lead manifest processing
Context: All follower manifests have been processed OR no follower manifests exist
GIVEN
All follower manifests have been processed OR no follower manifests exist
Applied to: Continue with Lead Manifest Processing
WHEN
The system completes follower processing workflow
THEN
The system returns control to continue processing the original lead manifest
Context: A cargo record is being processed for release verification
GIVEN
A cargo record is being processed for release verification
Applied to: Get Car ID and Waybill from Current Cargo
WHEN
The system needs to verify release status for all related cargo
THEN
The car ID and waybill number are extracted from the current cargo record and stored for subsequent cargo matching operations
Applied to: Retrieve Car ID and Waybill from Current Cargo
WHEN
The system needs to identify related cargo records by transportation unit
THEN
The car ID and waybill number are extracted from the current cargo record for use in subsequent searches
Context: Multi-cargo release verification is starting
GIVEN
Multi-cargo release verification is starting
Applied to: Initialize Cargo Scan Counter
WHEN
The system begins scanning related cargo records
THEN
All cargo scan counters and release eligibility flags are reset to initial values
Context: Car ID and waybill criteria are established
GIVEN
Car ID and waybill criteria are established
Applied to: Fetch All Cargo Records Matching Car ID and Waybill
WHEN
The system searches for related cargo records
THEN
All cargo records matching the car ID and waybill combination are retrieved and made available for release verification processing
Context: Cargo records are being scanned for release verification
GIVEN
Cargo records are being scanned for release verification
Applied to: More Cargo Records?
WHEN
The system checks for remaining unprocessed cargo records
THEN
If more cargo records exist, processing continues with the next record, otherwise the verification analysis phase begins
Context: Additional cargo records are available for processing
GIVEN
Additional cargo records are available for processing
Applied to: Get Next Cargo Record
WHEN
The system continues the release verification scan
THEN
The next cargo record matching the car ID and waybill is retrieved and made current for release status checking
Context: A cargo record is being evaluated for release verification
GIVEN
A cargo record is being evaluated for release verification
Applied to: Check Cargo Release Status
WHEN
The system checks the cargo's current release status
THEN
The cargo's release status is determined and used to direct further validation checks
Context: Cargo release status has been evaluated
GIVEN
Cargo release status has been evaluated
Applied to: Is Cargo Released?
WHEN
The system determines if the cargo is currently in released status
THEN
If cargo is not released, active hold checks are performed, otherwise manual release flag validation is conducted
Context: Cargo is not currently in released status
GIVEN
Cargo is not currently in released status
Applied to: Check for Active Holds
WHEN
The system checks for active hold conditions on the cargo
THEN
All active hold flags and conditions are evaluated to determine if holds exist that prevent release
Context: Active hold conditions have been checked
GIVEN
Active hold conditions have been checked
Applied to: Has Active Holds?
WHEN
The system evaluates whether active holds exist
THEN
If active holds are present, cargo is marked as not release eligible, otherwise manual release flag checking continues
Context: Cargo has active hold conditions
GIVEN
Cargo has active hold conditions
Applied to: Mark as Not Release Eligible
WHEN
The system processes cargo with active holds
THEN
The cargo is marked as not eligible for release and the release eligibility counter is updated accordingly
Context: Cargo does not have active holds or is in released status
GIVEN
Cargo does not have active holds or is in released status
Applied to: Check Manual Release Flag
WHEN
The system checks for manual release authorization
THEN
The manual release flag is evaluated to determine if special release authorization has been granted
Context: Manual release flag has been checked
GIVEN
Manual release flag has been checked
Applied to: Manually Released?
WHEN
The system evaluates manual release authorization
THEN
If manual release is authorized, cargo is marked as release eligible, otherwise quantity validation is performed
Context: Cargo has manual release authorization or passes all validation checks
GIVEN
Cargo has manual release authorization or passes all validation checks
Applied to: Mark as Release Eligible
WHEN
The system processes cargo with release authorization
THEN
The cargo is marked as eligible for release and the release eligibility counter is updated
Context: Cargo does not have manual release authorization
GIVEN
Cargo does not have manual release authorization
Applied to: Check Quantity Validation
WHEN
The system performs quantity validation for release eligibility
THEN
Cargo quantities are compared against expected values and release thresholds to determine validation status
Context: Quantity validation has been performed
GIVEN
Quantity validation has been performed
Applied to: Quantities Match?
WHEN
The system evaluates whether quantities match requirements
THEN
If quantities match, cargo is marked as release eligible, otherwise cargo is marked for partial release
Context: Cargo quantities do not match full release requirements
GIVEN
Cargo quantities do not match full release requirements
Applied to: Mark as Partial Release
WHEN
The system processes cargo with quantity mismatches
THEN
The cargo is marked for partial release status and the release eligibility counter is updated to reflect partial release
Context: Cargo release eligibility has been determined
GIVEN
Cargo release eligibility has been determined
Applied to: Update Release Eligibility Counter
WHEN
The system updates release verification statistics
THEN
Release eligibility counters are incremented based on the cargo's determined status (eligible, not eligible, or partial)
Context: Current cargo record processing is complete
GIVEN
Current cargo record processing is complete
Applied to: Move to Next Cargo Record
WHEN
The system continues the multi-cargo verification process
THEN
The system positions to process the next cargo record in the car ID and waybill group
Context: All cargo records for the car ID and waybill have been processed
GIVEN
All cargo records for the car ID and waybill have been processed
Applied to: Analyze Overall Release Status
WHEN
The system analyzes overall release verification results
THEN
Individual cargo release statuses are consolidated to determine the overall release eligibility for the entire car and waybill group
Context: Overall release status analysis is complete
GIVEN
Overall release status analysis is complete
Applied to: All Cargo Release Eligible?
WHEN
The system determines final release authorization
THEN
If all cargo is release eligible, overall status is set to YES, otherwise overall status is set to NO
Context: All cargo in the car and waybill group is release eligible
GIVEN
All cargo in the car and waybill group is release eligible
Applied to: Set Overall Release Status = YES
WHEN
The system sets final release authorization
THEN
The overall release status is set to YES, indicating full authorization for release of all cargo
Context: One or more cargo records in the car and waybill group are not release eligible
GIVEN
One or more cargo records in the car and waybill group are not release eligible
Applied to: Set Overall Release Status = NO
WHEN
The system sets final release authorization
THEN
The overall release status is set to NO, preventing release of the entire car and waybill group
Context: Release verification analysis is complete
GIVEN
Release verification analysis is complete
Applied to: Generate Release Verification Report
WHEN
The system generates verification documentation
THEN
A detailed report is created showing all cargo evaluated, their individual statuses, and the final overall release determination
Context: Release verification process is complete and documented
GIVEN
Release verification process is complete and documented
Applied to: Return Release Verification Result
WHEN
The system returns verification results
THEN
The final release status (YES/NO) and supporting verification details are returned to enable appropriate cargo handling decisions
Context: An error message has been generated and requires routing
GIVEN
An error message has been generated and requires routing
Applied to: Set Primary Destination User
WHEN
The system determines the message type and attempts to set the primary destination user
THEN
The primary destination user is identified and validated for message routing
Context: A primary destination user has been identified
GIVEN
A primary destination user has been identified
Applied to: Is Primary User Valid?
WHEN
The system validates the primary user credentials and routing permissions
THEN
The system determines if the primary user is valid and can receive the message
Context: The primary user has been validated as a valid recipient
GIVEN
The primary user has been validated as a valid recipient
Applied to: Route to Primary User
WHEN
The system processes the routing request
THEN
The error message is routed to the primary user destination
Context: The primary user has been determined to be invalid
GIVEN
The primary user has been determined to be invalid
Applied to: Route to Default Error User
WHEN
The system needs to route the error message
THEN
The error message is routed to the default error user destination
Context: The error message has been routed to either primary or default error user
GIVEN
The error message has been routed to either primary or default error user
Applied to: Additional Recipients Required?
WHEN
The system evaluates the message type and routing requirements
THEN
The system determines whether additional recipients are required for this message type
Context: Additional recipients have been determined to be required
GIVEN
Additional recipients have been determined to be required
Applied to: Identify Secondary Recipients
WHEN
The system processes the secondary recipient identification logic
THEN
The system identifies all secondary recipients that should receive the error message
Context: Secondary recipients have been identified
GIVEN
Secondary recipients have been identified
Applied to: Check Secondary User Validity
WHEN
The system validates each secondary user's credentials and routing permissions
THEN
The system determines which secondary users are valid recipients
Context: A secondary user has been validated as a valid recipient
GIVEN
A secondary user has been validated as a valid recipient
Applied to: Add Valid Secondary User to Route List
WHEN
The system processes the routing list update
THEN
The valid secondary user is added to the message routing list
Context: A secondary user has been determined to be invalid
GIVEN
A secondary user has been determined to be invalid
Applied to: Skip Invalid Secondary User
WHEN
The system processes the routing list
THEN
The invalid secondary user is skipped and not added to the routing list
Context: All valid recipients have been identified and added to the routing list
GIVEN
All valid recipients have been identified and added to the routing list
Applied to: Set Message Keywords for Categorization
WHEN
The system processes message categorization requirements
THEN
Appropriate keywords are set for message categorization and proper routing
Context: Message keywords have been set for categorization
GIVEN
Message keywords have been set for categorization
Applied to: Export Container Type?
WHEN
The system evaluates the message content and type
THEN
The system determines if this is an export container type message
Context: The message has been determined to be an export container type
GIVEN
The message has been determined to be an export container type
Applied to: Route to USEXP Basket
WHEN
The system processes the specialized routing requirement
THEN
The message is routed to the USEXP basket for export container processing
Context: The message has been determined to not be an export container type
GIVEN
The message has been determined to not be an export container type
Applied to: Route to Standard Error Basket
WHEN
The system processes the standard routing requirement
THEN
The message is routed to the standard error basket for general error processing
Context: All routing destinations have been determined and validated
GIVEN
All routing destinations have been determined and validated
Applied to: Send Message to All Valid Destinations
WHEN
The system executes the message delivery process
THEN
The error message is successfully sent to all valid destinations in the routing list
Context: The error message has been sent to all valid destinations
GIVEN
The error message has been sent to all valid destinations
Applied to: Log Routing Information
WHEN
The system processes the logging requirements
THEN
Routing information including destinations and delivery status is logged for audit purposes
Context: A lead manifest is identified for processing
GIVEN
A lead manifest is identified for processing
Applied to: Check for Follower Manifests
WHEN
The system checks if the lead manifest CCN matches the saved CCN from previous processing
THEN
The system identifies whether follower manifests exist and need to be processed
Context: Follower manifests are found for a lead manifest
GIVEN
Follower manifests are found for a lead manifest
Applied to: Initialize Follower Processing
WHEN
The system initiates follower processing
THEN
The follower end-of-database flag is reset and processing begins
Context: Follower manifest processing is in progress
GIVEN
Follower manifest processing is in progress
Applied to: More Followers to Process?
WHEN
The system checks the follower end-of-database flag
THEN
Processing continues if more followers exist or terminates if all followers are processed
Context: A follower manifest is selected for processing
GIVEN
A follower manifest is selected for processing
Applied to: Prepare EDI 350 Message for Follower
WHEN
The system prepares the EDI message
THEN
The special action code is set to '350', disposition code is copied from X4 segment, quantity is transferred, and entry number is populated
Context: EDI 350 message is prepared for a follower manifest
GIVEN
EDI 350 message is prepared for a follower manifest
Applied to: Spawn GCT0161E Transaction
WHEN
The system spawns the GCT0161E transaction
THEN
The follower manifest is submitted for independent cargo processing with the prepared message data
Context: A follower manifest has been submitted for processing via GCT0161E
GIVEN
A follower manifest has been submitted for processing via GCT0161E
Applied to: Processing Successful?
WHEN
The processing transaction completes
THEN
The system determines if the processing was successful or encountered errors
Context: A follower manifest processing attempt has completed (either successfully or with errors)
GIVEN
A follower manifest processing attempt has completed (either successfully or with errors)
Applied to: Continue to Next Follower
WHEN
The system continues processing
THEN
The next follower manifest in the sequence is selected for processing
Context: All follower manifests associated with a lead manifest have been processed
GIVEN
All follower manifests associated with a lead manifest have been processed
Applied to: Complete Multi-manifest Processing
WHEN
No more followers remain in the processing queue
THEN
The multi-manifest processing operation is marked as complete and control returns to the main processing flow
Context: More follower manifests are available for processing
GIVEN
More follower manifests are available for processing
Applied to: Select Next Follower Manifest
WHEN
The system needs to process the next follower manifest
THEN
The system selects and loads the next follower manifest from the list
Context: An EDI 350 message has been formatted for a follower manifest
GIVEN
An EDI 350 message has been formatted for a follower manifest
Applied to: Prepare Message Array for Follower
WHEN
The system needs to prepare the message for transaction spawning
THEN
The system populates the EDI message array with the formatted follower manifest data
Context: The message array has been prepared for a follower manifest
GIVEN
The message array has been prepared for a follower manifest
Applied to: Set Follower Manifest Parameters
WHEN
The system needs to configure processing parameters
THEN
The system sets follower-specific parameters including manifest identifiers and processing flags
Context: Follower manifest parameters have been configured
GIVEN
Follower manifest parameters have been configured
Applied to: Spawn GCT0161E Transaction
WHEN
The system is ready to process the follower manifest
THEN
The system spawns a GCT0161E transaction with the prepared message array and parameters
Context: A GCT0161E transaction has been attempted for a follower manifest
GIVEN
A GCT0161E transaction has been attempted for a follower manifest
Applied to: Transaction Spawn Successful?
WHEN
The system receives the spawn response
THEN
The system determines if the transaction spawn was successful or failed
Context: A GCT0161E transaction was successfully spawned for a follower manifest
GIVEN
A GCT0161E transaction was successfully spawned for a follower manifest
Applied to: Log Follower Processing Success
WHEN
The system confirms successful transaction spawn
THEN
The system logs the successful follower manifest processing to the transaction log
Context: A GCT0161E transaction spawn failed for a follower manifest
GIVEN
A GCT0161E transaction spawn failed for a follower manifest
Applied to: Log Spawn Error
WHEN
The system detects the spawn failure
THEN
The system logs the spawn error details to the transaction log for troubleshooting
Context: A follower manifest has been successfully processed
GIVEN
A follower manifest has been successfully processed
Applied to: Move to Next Follower
WHEN
The system needs to continue with remaining followers
THEN
The system moves to the next follower manifest in the list for processing
Context: A transaction spawn error has been logged for a follower manifest
GIVEN
A transaction spawn error has been logged for a follower manifest
Applied to: Continue with Next Follower
WHEN
The system needs to continue processing remaining followers
THEN
The system continues with the next follower manifest without stopping the entire process
Context: The system has iterated through all follower manifests in the list
GIVEN
The system has iterated through all follower manifests in the list
Applied to: All Followers Processed
WHEN
No more follower manifests are available for processing
THEN
The system confirms that all follower manifests have been processed
Context: All follower manifests have been processed
GIVEN
All follower manifests have been processed
Applied to: Update Lead Manifest Status
WHEN
The system needs to finalize the lead manifest processing
THEN
The system updates the lead manifest status to reflect completion of follower processing
Context: The lead manifest status has been updated after follower processing
GIVEN
The lead manifest status has been updated after follower processing
Applied to: Complete Multi-manifest Processing
WHEN
All multi-manifest processing tasks are complete
THEN
The system completes the multi-manifest processing workflow and returns control
Context: A manifest is not identified as a lead manifest
GIVEN
A manifest is not identified as a lead manifest
Applied to: Skip - Single Manifest Only
WHEN
The system evaluates the manifest for multi-manifest processing
THEN
The system skips follower processing and proceeds directly to completion
Context: A car ID and waybill number have been identified from a cargo record
GIVEN
A car ID and waybill number have been identified from a cargo record
Applied to: Search All Cargo Records with Matching Car ID and Waybill
WHEN
The system searches for all related cargo records
THEN
All cargo records matching the same car ID and waybill combination are retrieved for group processing
Context: A search has been performed for cargo records matching a car ID and waybill
GIVEN
A search has been performed for cargo records matching a car ID and waybill
Applied to: More Cargo Records Found?
WHEN
The system processes the search results
THEN
Each cargo record in the result set is processed individually until all records are evaluated
Context: A cargo record is being evaluated for release eligibility
GIVEN
A cargo record is being evaluated for release eligibility
Applied to: Is Cargo Already Released?
WHEN
The cargo status indicates it has already been released
THEN
The cargo is excluded from further release processing and the system continues to the next cargo record
Context: A cargo record that is not already released is being evaluated
GIVEN
A cargo record that is not already released is being evaluated
Applied to: Are There Active Holds?
WHEN
The system checks for active hold conditions
THEN
If active holds exist, the cargo requires manual release authorization; if no active holds exist, the cargo is eligible for release
Context: A cargo record has active holds that would normally prevent release
GIVEN
A cargo record has active holds that would normally prevent release
Applied to: Is Manual Release Set?
WHEN
Manual release authorization has been granted for the cargo
THEN
The cargo is marked as release eligible despite the active holds
Context: A cargo record has been evaluated and either has no active holds or has manual release authorization
GIVEN
A cargo record has been evaluated and either has no active holds or has manual release authorization
Applied to: Mark Cargo as Release Eligible
WHEN
The release eligibility determination is made
THEN
The cargo is marked as release eligible and added to the release eligible list
Context: A cargo record has active holds and no manual release authorization has been granted
GIVEN
A cargo record has active holds and no manual release authorization has been granted
Applied to: Mark Cargo as Not Release Eligible
WHEN
The release eligibility determination is made
THEN
The cargo is marked as not release eligible and added to the hold list
Context: Cargo records are being processed for a specific car ID and waybill combination
GIVEN
Cargo records are being processed for a specific car ID and waybill combination
Applied to: All Cargo Records Processed?
WHEN
The system checks if all matching records have been evaluated
THEN
If all records are processed, proceed to generate release verification summary; otherwise continue processing remaining records
Context: All cargo records for a car ID and waybill combination have been evaluated for release eligibility
GIVEN
All cargo records for a car ID and waybill combination have been evaluated for release eligibility
Applied to: Generate Release Verification Summary
WHEN
The system generates the verification summary
THEN
A summary report is created showing which cargo records are release eligible and which are held, along with the reasons for hold status
Context: Release verification has been completed for all cargo records matching a car ID and waybill
GIVEN
Release verification has been completed for all cargo records matching a car ID and waybill
Applied to: Update Release Eligibility Status for All Matching Cargo
WHEN
The system updates the release eligibility status
THEN
All cargo records in the group have their release eligibility status updated based on the verification results