Documentation
¶
Index ¶
Constants ¶
const ICNRandomMax int64 = 999999999
ICNRandomMax is the largest allowed random-number based ICN (we use random ICN numbers in development)
const ICNRandomMin int64 = 100000000
ICNRandomMin is the smallest allowed random-number based ICN (we use random ICN numbers in development)
const ICNSequenceName = "interchange_control_number"
ICNSequenceName used to query Interchange Control Numbers from DB
const ServiceItemSegmentsSizeWithoutFA2s int = 6
ServiceItemSegmentsSizeWithoutFA2s is the number of fields in the ServiceItemSegments struct that does not include the FA2s
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Invoice858C ¶
type Invoice858C struct { ISA edisegment.ISA GS edisegment.GS ST edisegment.ST Header InvoiceHeader ServiceItems []ServiceItemSegments `validate:"min=1,dive"` L3 edisegment.L3 SE edisegment.SE GE edisegment.GE IEA edisegment.IEA }
Invoice858C holds all the segments that are generated
func (Invoice858C) EDIString ¶
func (invoice Invoice858C) EDIString(logger *zap.Logger) (string, error)
EDIString returns the EDI representation of an 858C
func (Invoice858C) Segments ¶
func (invoice Invoice858C) Segments() [][]string
Segments returns the invoice as an array of rows (string arrays), each containing a segment, to prepare it for writing
func (Invoice858C) Validate ¶
func (invoice Invoice858C) Validate() error
Validate will validate the invoice struct (and nested structs) to make sure they will produce legal EDI. This returns either an InvalidValidationError or a validator.ValidationErrors that allows all validation errors to be introspected individually.
type InvoiceHeader ¶
type InvoiceHeader struct { ShipmentInformation edisegment.BX PaymentRequestNumber edisegment.N9 ContractCode edisegment.N9 ServiceMemberName edisegment.N9 OrderPayGrade edisegment.N9 ServiceMemberBranch edisegment.N9 ServiceMemberID edisegment.N9 MoveCode edisegment.N9 Currency edisegment.C3 RequestedPickupDate *edisegment.G62 ScheduledPickupDate *edisegment.G62 ActualPickupDate *edisegment.G62 BuyerOrganizationName edisegment.N1 SellerOrganizationName edisegment.N1 DestinationName edisegment.N1 DestinationStreetAddress *edisegment.N3 DestinationPostalDetails edisegment.N4 DestinationPhone *edisegment.PER OriginName edisegment.N1 OriginStreetAddress *edisegment.N3 OriginPostalDetails edisegment.N4 OriginPhone *edisegment.PER }
InvoiceHeader holds all of the segments that are part of an Invoice858C's Header
func (*InvoiceHeader) NonEmptySegments ¶
func (ih *InvoiceHeader) NonEmptySegments() []edisegment.Segment
NonEmptySegments produces an array of all of the fields in an InvoiceHeader that are not nil
func (*InvoiceHeader) Size ¶
func (ih *InvoiceHeader) Size() int
Size returns the number of fields in an InvoiceHeader that are not nil
type InvoiceResponseHeader ¶
type InvoiceResponseHeader struct { ISA edisegment.ISA GS edisegment.GS ST edisegment.ST }
InvoiceResponseHeader holds all the segments used in the headers of the 997, 824 and 810 response types
type ServiceItemSegments ¶
type ServiceItemSegments struct { HL edisegment.HL N9 edisegment.N9 L5 edisegment.L5 L0 edisegment.L0 L1 edisegment.L1 FA1 edisegment.FA1 FA2s []edisegment.FA2 }
ServiceItemSegments holds segments that are required for every service item