Skip to content

Conversation

@HenrikHL
Copy link
Contributor

@HenrikHL HenrikHL commented Jan 11, 2026

User description

SD-2666: Fixed HouseBL bug where the NationalCommodityCode was not a list

Reason for fixing: https://dcsa.atlassian.net/browse/SD-2666?focusedCommentId=28715


PR Type

Bug fix


Description

  • Changed extendedNationalCommodityCode to array type extendedNationalCommodityCodes

  • Added comprehensive documentation clarifying precedence rules

  • Supports up to 16 character extended commodity codes

  • Specifies that extendedNationalCommodityCodes takes precedence over nationalCommodityCode


Diagram Walkthrough

flowchart LR
  A["ConsignmentItem"] -- "contains" --> B["nationalCommodityCode"]
  A -- "contains" --> C["extendedNationalCommodityCodes<br/>(array)"]
  C -- "items" --> D["ExtendedNationalCommodityCode"]
  E["Precedence Rule:<br/>extendedNationalCommodityCodes<br/>overrides nationalCommodityCode"] -.-> C
Loading

File Walkthrough

Relevant files
Bug fix
EBL_v3.0.3.yaml
Convert extended commodity code to array type                       

ebl/v3/EBL_v3.0.3.yaml

  • Renamed extendedNationalCommodityCode to
    extendedNationalCommodityCodes and changed to array type
  • Added array wrapper with type: array and items reference
  • Added detailed description explaining the field supports up to 16
    character codes
  • Documented precedence rule that extendedNationalCommodityCodes takes
    precedence over nationalCommodityCode
+8/-2     

@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #SD-2666
🔴 Add new field `extendedHSCodes` to support up to 12 characters.
Deprecate existing fields HSCodes and nationalCommodityCode.value (kept for backward
compatibility but clearly marked as deprecated).
Apply the change to both Booking and eBL (SI, TD, ISSU, PINT) standards.
Add new field `nationalCommodityCode.extendedValue` to support up to 16 characters.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Length enforcement unclear: The description states extendedNationalCommodityCodes supports up to 16 characters, but
the diff does not show an explicit schema constraint (e.g., maxLength) to enforce this at
validation time.

Referred Code
extendedNationalCommodityCodes:
  type: array
  description: |
    A list of `National Commodity Codes` that apply to this `consignmentItem`. The `extendedNationalCommodityCodes` support up to 16 character codes.

    **Note:** If both `nationalCommodityCode` and `extendedNationalCommodityCodes` are provided then `extendedNationalCommodityCodes` takes precedence and `nationalCommodityCode` must be ignored.
  items:
    $ref: '#/components/schemas/ExtendedNationalCommodityCode'

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Prevent providing an empty array

Add minItems: 1 to the extendedNationalCommodityCodes array definition to ensure
it is not sent as an empty array.

ebl/v3/EBL_v3.0.3.yaml [6205-6212]

 extendedNationalCommodityCodes:
   type: array
   description: |
     A list of `National Commodity Codes` that apply to this `consignmentItem`. The `extendedNationalCommodityCodes` support up to 16 character codes.
     
     **Note:** If both `nationalCommodityCode` and `extendedNationalCommodityCodes` are provided then `extendedNationalCommodityCodes` takes precedence and `nationalCommodityCode` must be ignored.
+  minItems: 1
   items:
     $ref: '#/components/schemas/ExtendedNationalCommodityCode'
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: This suggestion correctly proposes adding minItems: 1 to ensure the extendedNationalCommodityCodes array is not empty, which is a good practice for API definitions and is consistent with other array definitions in the file.

Low
Ensure array items are unique

Add uniqueItems: true to the extendedNationalCommodityCodes array definition to
prevent duplicate commodity codes.

ebl/v3/EBL_v3.0.3.yaml [6205-6212]

 extendedNationalCommodityCodes:
   type: array
   description: |
     A list of `National Commodity Codes` that apply to this `consignmentItem`. The `extendedNationalCommodityCodes` support up to 16 character codes.
     
     **Note:** If both `nationalCommodityCode` and `extendedNationalCommodityCodes` are provided then `extendedNationalCommodityCodes` takes precedence and `nationalCommodityCode` must be ignored.
+  uniqueItems: true
   items:
     $ref: '#/components/schemas/ExtendedNationalCommodityCode'
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: This suggestion correctly proposes adding uniqueItems: true to the extendedNationalCommodityCodes array, which improves data integrity by preventing duplicate entries.

Low
  • More

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