Documentation ¶
Index ¶
- Variables
- func FloatToNx(n float64, x int) string
- func NxToFloat(s string, x int) (float64, error)
- type AK1
- type AK2
- type AK3
- type AK4
- type AK5
- type AK9
- type BGN
- type BX
- type C3
- type FA1
- type FA2
- type FA2DetailCode
- type G62
- type GE
- type GS
- type HL
- type IEA
- type ISA
- type L0
- type L1
- type L10
- type L3
- type L5
- type L7
- type LX
- type MEA
- type N1
- type N3
- type N4
- type N9
- type NTE
- type OTI
- type PER
- type SE
- type ST
- type Segment
- type TED
Constants ¶
This section is empty.
Variables ¶
var AffiliationToAgency = map[models.ServiceMemberAffiliation]string{ models.AffiliationARMY: "DZ", models.AffiliationNAVY: "DN", models.AffiliationMARINES: "DX", models.AffiliationAIRFORCE: "DY", models.AffiliationCOASTGUARD: "HS", }
AffiliationToAgency is a map from our affiliation to the FA1 segment's AgencyQualifierCode field
Functions ¶
Types ¶
type AK1 ¶
type AK1 struct { FunctionalIdentifierCode string `validate:"eq=SI"` GroupControlNumber int64 `validate:"min=1,max=999999999"` }
AK1 represents the AK1 EDI segment
func (*AK1) StringArray ¶
StringArray converts AK1 to an array of strings
type AK2 ¶
type AK2 struct { TransactionSetIdentifierCode string `validate:"eq=858"` TransactionSetControlNumber string `validate:"min=4,max=9"` }
AK2 represents the AK2 EDI segment
func (*AK2) StringArray ¶
StringArray converts AK2 to an array of strings
type AK3 ¶
type AK3 struct { SegmentIDCode string `validate:"min=2,max=3"` SegmentPositionInTransactionSet int `validate:"min=1,max=999999"` LoopIdentifierCode string `validate:"omitempty,min=1,max=6"` SegmentSyntaxErrorCode string `validate:"omitempty,min=1,max=3"` }
AK3 represents the AK3 EDI segment
func (*AK3) StringArray ¶
StringArray converts AK3 to an array of strings
type AK4 ¶
type AK4 struct { PositionInSegment int `validate:"min=1,max=99"` ElementPositionInSegment int `validate:"min=1,max=99"` ComponentDataElementPositionInComposite int `validate:"omitempty,min=1,max=99"` DataElementReferenceNumber int `validate:"omitempty,min=1,max=9999"` DataElementSyntaxErrorCode string `validate:"min=1,max=3"` CopyOfBadDataElement string `validate:"omitempty,max=99"` }
AK4 represents the AK4 EDI segment
func (*AK4) StringArray ¶
StringArray converts AK4 to an array of strings
type AK5 ¶
type AK5 struct { TransactionSetAcknowledgmentCode string `validate:"len=1"` // only expect to use this field TransactionSetSyntaxErrorCodeAK502 string `validate:"omitempty,max=3"` // not expecting these fields to be set TransactionSetSyntaxErrorCodeAK503 string `validate:"omitempty,max=3"` // not expecting these fields to be set TransactionSetSyntaxErrorCodeAK504 string `validate:"omitempty,max=3"` // not expecting these fields to be set TransactionSetSyntaxErrorCodeAK505 string `validate:"omitempty,max=3"` // not expecting these fields to be set TransactionSetSyntaxErrorCodeAK506 string `validate:"omitempty,max=3"` // not expecting these fields to be set }
AK5 represents the AK5 EDI segment Purpose: To acknowledge acceptance or rejection and report errors in a transaction set (direct language from the 997 spec, though we don't expect to process any errors in the 997, only expect to get acks here)
func (*AK5) StringArray ¶
StringArray converts AK5 to an array of strings
type AK9 ¶
type AK9 struct { FunctionalGroupAcknowledgeCode string `validate:"oneof=A E P R"` NumberOfTransactionSetsIncluded int `validate:"min=1,max=999999"` NumberOfReceivedTransactionSets int `validate:"min=1,max=999999"` NumberOfAcceptedTransactionSets int `validate:"min=0,max=999999"` FunctionalGroupSyntaxErrorCodeAK905 string `validate:"omitempty,max=3"` FunctionalGroupSyntaxErrorCodeAK906 string `validate:"omitempty,max=3"` FunctionalGroupSyntaxErrorCodeAK907 string `validate:"omitempty,max=3"` FunctionalGroupSyntaxErrorCodeAK908 string `validate:"omitempty,max=3"` FunctionalGroupSyntaxErrorCodeAK909 string `validate:"omitempty,max=3"` }
AK9 represents the AK9 EDI segment
func (*AK9) StringArray ¶
StringArray converts AK9 to an array of strings
type BGN ¶
type BGN struct { TransactionSetPurposeCode string `validate:"eq=11"` ReferenceIdentification string `validate:"min=1,max=30"` Date string `validate:"datetime=20060102"` }
BGN represents the BGN EDI segment
func (*BGN) StringArray ¶
StringArray converts BGN to an array of strings
type BX ¶
type BX struct { TransactionSetPurposeCode string `validate:"eq=00"` TransactionMethodTypeCode string `validate:"eq=J"` ShipmentMethodOfPayment string `validate:"eq=PP"` ShipmentIdentificationNumber string `validate:"min=1,max=30"` StandardCarrierAlphaCode string `validate:"alpha,min=2,max=4"` WeightUnitCode string `validate:"isdefault"` // not used ShipmentQualifier string `validate:"eq=4"` }
BX represents the BX EDI segment
func (*BX) StringArray ¶
StringArray converts BX to an array of strings
type C3 ¶
type C3 struct { // http://www.iso.org/iso/en/prods-services/popstds/currencycodeslist.html is the URL // referenced in the 858 standard, but that URL is not valid // https://en.wikipedia.org/wiki/ISO_4217 seems to be a good list to reference CurrencyCodeC301 string `validate:"omitempty,max=3"` ExchangeRate string `validate:"omitempty"` CurrencyCodeC303 string `validate:"omitempty,max=3"` CurrencyCodeC304 string `validate:"omitempty,max=3"` }
C3 represents the C3 EDI segment (Currency)
func (*C3) StringArray ¶
StringArray converts C3 to an array of strings
type FA1 ¶
type FA1 struct {
AgencyQualifierCode string `validate:"oneof=DN DX DY DZ DF HS"`
}
FA1 represents the FA1 EDI segment
func (*FA1) StringArray ¶
StringArray converts FA1 to an array of strings
type FA2 ¶
type FA2 struct { BreakdownStructureDetailCode FA2DetailCode `validate:"oneof=TA ZZ A1 A2 A3 A4 A5 A6 B1 B2 B3 C1 C2 D1 D4 D6 D7 E1 E2 E3 F1 F3 G2 I1 J1 K6 L1 M1 N1 P5"` FinancialInformationCode string `validate:"min=1,max=80"` }
FA2 represents the FA2 EDI segment
func (*FA2) StringArray ¶
StringArray converts FA2 to an array of strings
type FA2DetailCode ¶
type FA2DetailCode string
const ( // FA2DetailCodeTA is Transportation Account Code (TAC) FA2DetailCodeTA FA2DetailCode = "TA" // FA2DetailCodeZZ is Mutually Defined FA2DetailCodeZZ FA2DetailCode = "ZZ" // FA2DetailCodeA1 is Department Indicator FA2DetailCodeA1 FA2DetailCode = "A1" // FA2DetailCodeA2 is Transfer from Department FA2DetailCodeA2 FA2DetailCode = "A2" // FA2DetailCodeA3 is Fiscal Year Indicator FA2DetailCodeA3 FA2DetailCode = "A3" // FA2DetailCodeA4 is Basic Symbol Number FA2DetailCodeA4 FA2DetailCode = "A4" // FA2DetailCodeA5 is Sub-class FA2DetailCodeA5 FA2DetailCode = "A5" // FA2DetailCodeA6 is Sub-Account Symbol FA2DetailCodeA6 FA2DetailCode = "A6" // FA2DetailCodeB1 is Budget Activity Number FA2DetailCodeB1 FA2DetailCode = "B1" // FA2DetailCodeB2 is Budget Sub-activity Number FA2DetailCodeB2 FA2DetailCode = "B2" // FA2DetailCodeB3 is Budget Program Activity FA2DetailCodeB3 FA2DetailCode = "B3" // FA2DetailCodeC1 is Program Element FA2DetailCodeC1 FA2DetailCode = "C1" // FA2DetailCodeC2 is Project Task or Budget Subline FA2DetailCodeC2 FA2DetailCode = "C2" // FA2DetailCodeD1 is Defense Agency Allocation Recipient FA2DetailCodeD1 FA2DetailCode = "D1" // FA2DetailCodeD4 is Component Sub-allocation Recipient FA2DetailCodeD4 FA2DetailCode = "D4" // FA2DetailCodeD6 is Sub-allotment Recipient FA2DetailCodeD6 FA2DetailCode = "D6" // FA2DetailCodeD7 is Work Center Recipient FA2DetailCodeD7 FA2DetailCode = "D7" // FA2DetailCodeE1 is Major Reimbursement Source Code FA2DetailCodeE1 FA2DetailCode = "E1" // FA2DetailCodeE2 is Detail Reimbursement Source Code FA2DetailCodeE2 FA2DetailCode = "E2" // FA2DetailCodeE3 is Customer Indicator FA2DetailCodeE3 FA2DetailCode = "E3" // FA2DetailCodeF1 is Object Class FA2DetailCodeF1 FA2DetailCode = "F1" // FA2DetailCodeF3 is Government or Public Sector Identifier FA2DetailCodeF3 FA2DetailCode = "F3" // FA2DetailCodeG2 is Special Interest Code or Special Program Cost Code FA2DetailCodeG2 FA2DetailCode = "G2" // FA2DetailCodeI1 is Abbreviated Department of Defense (DoD) Budget and Accounting Classification Code (BACC) FA2DetailCodeI1 FA2DetailCode = "I1" // FA2DetailCodeJ1 is Document or Record Reference Number FA2DetailCodeJ1 FA2DetailCode = "J1" // FA2DetailCodeK6 is Accounting Classification Reference Code FA2DetailCodeK6 FA2DetailCode = "K6" // FA2DetailCodeL1 is Accounting Installation Number FA2DetailCodeL1 FA2DetailCode = "L1" // FA2DetailCodeM1 is Local Installation Data FA2DetailCodeM1 FA2DetailCode = "M1" // FA2DetailCodeN1 is Transaction Type FA2DetailCodeN1 FA2DetailCode = "N1" // FA2DetailCodeP5 is Security Cooperation Case Line Item Identifier FA2DetailCodeP5 FA2DetailCode = "P5" )
func (FA2DetailCode) String ¶
func (d FA2DetailCode) String() string
type G62 ¶
type G62 struct { DateQualifier int `validate:"oneof=10 76 86"` Date string `validate:"datetime=20060102"` TimeQualifier int `validate:"omitempty,oneof=5 8"` Time string `validate:"omitempty,required_with=TimeQualifier,datetime=1504"` }
G62 represents the G62 EDI segment Requested Pickup Date 68, Requested Pickup Time 5 Actual Pickup Date 86, Actual Pickup Time 8
func (*G62) StringArray ¶
StringArray converts G62 to an array of strings
type GE ¶
type GE struct { NumberOfTransactionSetsIncluded int `validate:"eq=1"` GroupControlNumber int64 `validate:"min=1,max=999999999"` }
GE represents the GE EDI segment
func (*GE) StringArray ¶
StringArray converts GE to an array of strings
type GS ¶
type GS struct { FunctionalIdentifierCode string `validate:"oneof=SI AG FA"` ApplicationSendersCode string `validate:"oneof=MILMOVE 8004171844"` ApplicationReceiversCode string `validate:"oneof=MILMOVE 8004171844"` Date string `validate:"datetime=20060102"` Time string `validate:"datetime=1504|datetime=150405"` GroupControlNumber int64 `validate:"min=1,max=999999999"` ResponsibleAgencyCode string `validate:"eq=X"` Version string `validate:"eq=004010"` }
GS represents the GS EDI segment
func (*GS) StringArray ¶
StringArray converts GS to an array of strings
type HL ¶
type HL struct { HierarchicalIDNumber string `validate:"alphanum,min=1,max=12"` HierarchicalParentIDNumber string `validate:"isdefault"` // not used HierarchicalLevelCode string `validate:"oneof=SS I 9"` }
HL represents the HL EDI segment
func (*HL) StringArray ¶
StringArray converts HL to an array of strings
type IEA ¶
type IEA struct { NumberOfIncludedFunctionalGroups int `validate:"eq=1"` InterchangeControlNumber int64 `validate:"min=1,max=999999999"` }
IEA represents the IEA EDI segment
func (*IEA) StringArray ¶
StringArray converts IEA to an array of strings
type ISA ¶
type ISA struct { AuthorizationInformationQualifier string `validate:"eq=00"` AuthorizationInformation string `validate:"omitempty,eq=0084182369"` SecurityInformationQualifier string `validate:"eq=00"` SecurityInformation string `validate:"omitempty,eq=0000000000"` InterchangeSenderIDQualifier string `validate:"oneof=12 ZZ"` InterchangeSenderID string `validate:"len=15"` InterchangeReceiverIDQualifier string `validate:"oneof=12 ZZ"` InterchangeReceiverID string `validate:"len=15"` InterchangeDate string `validate:"datetime=060102"` InterchangeTime string `validate:"datetime=1504"` InterchangeControlStandards string `validate:"eq=U"` InterchangeControlVersionNumber string `validate:"eq=00401"` InterchangeControlNumber int64 `validate:"min=1,max=999999999"` AcknowledgementRequested int `validate:"oneof=0 1"` UsageIndicator string `validate:"oneof=P T"` ComponentElementSeparator string `validate:"oneof=0x7C :"` // Have to escape pipe symbol }
ISA represents the ISA EDI segment
func (*ISA) StringArray ¶
StringArray converts ISA to an array of strings
type L0 ¶
type L0 struct { LadingLineItemNumber int `validate:"min=1,max=999"` // L001 BilledRatedAsQuantity float64 `validate:"required_with=BilledRatedAsQualifier"` // L002 BilledRatedAsQualifier string `validate:"required_with=BilledRatedAsQuantity,omitempty,len=2"` // L003 Weight float64 `validate:"required_with=WeightQualifier WeightUnitCode"` // L004 WeightQualifier string `validate:"required_with=Weight WeightUnitCode,omitempty,eq=B"` // L005 Volume float64 `validate:"required_with=VolumeUnitQualifier"` // L006 VolumeUnitQualifier string `validate:"required_with=Volume,omitempty,eq=E"` // L007 LadingQuantity int `validate:"required_with=PackagingFormCode,omitempty,min=1,max=9999999"` // L008 PackagingFormCode string `validate:"required_with=LadingQuantity,omitempty,len=3"` // L009 WeightUnitCode string `validate:"required_with=Weight WeightQualifier,omitempty,eq=L"` // L011 }
L0 represents the L0 EDI segment
func (*L0) StringArray ¶
StringArray converts L0 to an array of strings
type L1 ¶
type L1 struct { LadingLineItemNumber int `validate:"required,min=1,max=999"` FreightRate *float64 `validate:"omitempty,min=0"` RateValueQualifier string `validate:"required_with=FreightRate,omitempty,oneof=LB PF"` Charge int64 `validate:"required,min=-999999999999,max=999999999999"` // Supports negative values }
L1 represents the L1 EDI segment
func (*L1) StringArray ¶
StringArray converts L1 to an array of strings
type L10 ¶
type L10 struct { Weight float64 `validate:"required"` WeightQualifier string `validate:"eq=B"` WeightUnitCode string `validate:"eq=L"` }
L10 represents the B3 EDI segment
func (*L10) StringArray ¶
StringArray converts L10 to an array of strings
type L3 ¶
type L3 struct { Weight float64 `validate:"required_with=WeightQualifier,min=0,max=9999999999"` WeightQualifier string `validate:"required_with=Weight,omitempty,eq=B"` PriceCents int64 `validate:"min=-999999999999,max=999999999999"` // Supports negative values for FSC price }
L3 represents the L3 EDI segment
func (*L3) StringArray ¶
StringArray converts L3 to an array of strings
type L5 ¶
type L5 struct { LadingLineItemNumber int `validate:"min=1,max=999"` LadingDescription string `validate:"required"` CommodityCode string `validate:"required_with=CommodityCodeQualifier,omitempty,gt=0,lt=11"` CommodityCodeQualifier string `validate:"required_with=CommodityCode,omitempty,eq=D"` }
L5 represents the L5 EDI segment
func (*L5) StringArray ¶
StringArray converts L5 to an array of strings
type L7 ¶
type L7 struct { LadingLineItemNumber int `validate:"omitempty,min=1,max=999"` TariffNumber string `validate:"omitempty,min=1,max=7"` TariffItemNumber string `validate:"omitempty,min=1,max=16"` TariffDistance int `validate:"omitempty,min=1,max=99999"` }
L7 represents the B3 EDI segment
func (*L7) StringArray ¶
StringArray converts L7 to an array of strings
type LX ¶
type LX struct {
AssignedNumber int `validate:"min=1,max=999999"`
}
LX represents the LX EDI segment
func (*LX) StringArray ¶
StringArray converts LX to an array of strings
type MEA ¶
type MEA struct { MeasurementReferenceIDCode string `validate:"omitempty,len=2"` MeasurementQualifier string `validate:"omitempty,oneof=HT LN WD"` MeasurementValue float64 `validate:"required"` }
MEA represents the MEA EDI segment
func (*MEA) StringArray ¶
StringArray converts MEA to an array of strings
type N1 ¶
type N1 struct { EntityIdentifierCode string `validate:"oneof=BY SE ST SF RG RH"` Name string `validate:"min=1,max=60"` IdentificationCodeQualifier string `validate:"required_with=IdentificationCode,omitempty,oneof=2 10 27 92"` IdentificationCode string `validate:"required_with=IdentificationCodeQualifier,omitempty,min=2,max=80"` }
N1 represents the N1 EDI segment
func (*N1) StringArray ¶
StringArray converts N1 to an array of strings
type N3 ¶
type N3 struct { AddressInformation1 string `validate:"min=1,max=55"` AddressInformation2 string `validate:"omitempty,min=1,max=55"` }
N3 represents the N3 EDI segment
func (*N3) StringArray ¶
StringArray converts N3 to an array of strings
type N4 ¶
type N4 struct { CityName string `validate:"min=2,max=30"` StateOrProvinceCode string `validate:"len=2"` PostalCode string `validate:"min=3,max=15"` CountryCode string `validate:"omitempty,min=2,max=3"` LocationQualifier string `validate:"isdefault"` // not used LocationIdentifier string `validate:"isdefault"` // not used }
N4 represents the N4 EDI segment
func (*N4) StringArray ¶
StringArray converts N4 to an array of strings
type N9 ¶
type N9 struct { ReferenceIdentificationQualifier string `validate:"oneof=DY CN CT PQ OQ 1W ML 3L PO CMN 4A"` ReferenceIdentification string `validate:"min=1,max=30"` FreeFormDescription string `validate:"omitempty,min=1,max=45"` Date string `validate:"omitempty,datetime=20060102"` }
N9 represents the N9 EDI segment
func (*N9) StringArray ¶
StringArray converts N9 to an array of strings
type NTE ¶
type NTE struct { NoteReferenceCode string `validate:"omitempty,len=3"` Description string `validate:"min=1,max=80"` }
NTE represents the NTE EDI segment
func (*NTE) StringArray ¶
StringArray converts NTE to an array of strings
type OTI ¶
type OTI struct { ApplicationAcknowledgementCode string `validate:"oneof=TA TE TR"` ReferenceIdentificationQualifier string `validate:"oneof=BM CN"` ReferenceIdentification string `validate:"min=1,max=30"` ApplicationSendersCode string `validate:"omitempty,min=2,max=15"` ApplicationReceiversCode string `validate:"omitempty,min=2,max=15"` Date string `validate:"omitempty,datetime=20060102"` Time string `validate:"omitempty,datetime=1504"` GroupControlNumber int64 `validate:"required_with=TransactionSetControlNumber,omitempty,min=1,max=999999999"` TransactionSetControlNumber string `validate:"omitempty,min=4,max=9"` }
OTI represents the OTI EDI segment
func (*OTI) StringArray ¶
StringArray converts OTI to an array of strings
type PER ¶
type PER struct { ContactFunctionCode string `validate:"required,oneof=CN IC EM"` Name string `validate:"omitempty,min=1,max=60"` CommunicationNumberQualifier string `validate:"omitempty,eq=TE"` CommunicationNumber string `validate:"omitempty,min=1,max=80"` }
PER represents the PER EDI segment
func (*PER) StringArray ¶
StringArray converts PER to an array of strings
type SE ¶
type SE struct { NumberOfIncludedSegments int `validate:"min=1,max=9999999999"` TransactionSetControlNumber string `validate:"min=4,max=9"` }
SE represents the SE EDI segment
func (*SE) StringArray ¶
StringArray converts SE to an array of strings
type ST ¶
type ST struct { TransactionSetIdentifierCode string `validate:"oneof=858 997 824 810"` TransactionSetControlNumber string `validate:"min=4,max=9"` }
ST represents the ST EDI segment
func (*ST) StringArray ¶
StringArray converts ST to an array of strings
type TED ¶
type TED struct { ApplicationErrorConditionCode string `validate:"oneof=007 812 832 DUP IID INC K MJ PPD T ZZZ"` FreeFormMessage string `validate:"omitempty,max=60"` }
TED represents the TED EDI segment
func (*TED) StringArray ¶
StringArray converts TED to an array of strings