Variable: PREMIUM_820_BUILD_ERROR_CODES
constPREMIUM_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 anENTentity nor anNM1individual to open it, a remittance with noRMRopen 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
readonlyX12_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
}
}