Skip to main content
Version: v0.0.2

Variable: PREMIUM_820_BUILD_ERROR_CODES

const PREMIUM_820_BUILD_ERROR_CODES: object

Stable string codes for every Premium820BuildError. Locked here so consumers can narrow exhaustively on err.code; additions-only thereafter (renaming any code is a breaking change).

  • X12_820_BUILD_INVALID_SPEC - a structural precondition failed: no TRN trace, no remittance loop, a remittance with neither an ENT entity nor an NM1 individual to open it, a remittance with no RMR open item, an open item with no identity (empty qualifier + reference id), or an over-long ISA-13 interchange control number. The message carries structural indices + counts only - never a member id / name (PHI discipline).

Type Declaration

X12_820_BUILD_INVALID_SPEC

readonly X12_820_BUILD_INVALID_SPEC: "X12_820_BUILD_INVALID_SPEC" = "X12_820_BUILD_INVALID_SPEC"

Example

import { PREMIUM_820_BUILD_ERROR_CODES, Premium820BuildError, build820 } from "@cosyte/x12";
try {
build820(spec);
} catch (err) {
if (
err instanceof Premium820BuildError &&
err.code === PREMIUM_820_BUILD_ERROR_CODES.X12_820_BUILD_INVALID_SPEC
) {
// the remittance structure is impossible - fix the spec, do not emit
}
}