Documentation
¶
Overview ¶
Package inbound is the HTTP entrance for partners: POST /edi/inbound.
Input: a raw X12 004010 interchange in the body, a partner bearer token and the headers Message-Id, AS2-From and AS2-To (an emulation of AS2 without MIME and signatures). Output: HTTP 200 with an MDN (a JSON receipt) when the interchange is stored or was already stored; HTTP 422 or 409 with an error MDN when it is refused; and, for faults before the receipt, the gateway's single error format (internal/rpcerr).
Order, all on the server: address bucket and token (edge.Gate) -> only kind "partner" of an active partner of a tenant that has an interchange id -> bucket per partner -> body size and headers -> AS2-From and AS2-To against the token and the tenant -> strict parse -> ISA05:ISA06 and ISA07:ISA08 against the same -> one transaction that stores the interchange and its documents (a repeat of the same interchange returns the first MDN, another body under the same ISA13 is refused) -> one audit row.
For every functional group of 850 or 810 of a new interchange the same transaction queues a 997 to the partner (wave 2-9c, flow P1): AK5 A for a set the parser accepted, R with the AK3 and AK4 of its errors for a set it refused. The relay sends it like any other document.
A 997 is stored like any set and also matched, in the same transaction, to the document the gateway sent (partner that sent it, AK102, AK202): that is how a document becomes delivered or an incident (invariant I6).
The MDN confirms transport, not content: a set rejected by the parser or by the role of the partner is stored as rejected and the MDN still says "processed".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves /edi/inbound.
type MDN ¶
type MDN struct {
MessageID string `json:"message_id"`
OriginalMessageID string `json:"original_message_id"`
MICSHA256 string `json:"mic_sha256"`
Disposition string `json:"disposition"`
}
MDN is the receipt for an interchange. Field order is fixed by the struct, so the same MDN always gives the same bytes.