2267 lines
79 KiB
JavaScript
2267 lines
79 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.PercentageDetails = exports.PaymentTermsBasis = exports.PaymentInstructions = exports.Package = exports.NameAndAddress = exports.MaintenanceOperationDetails = exports.MonetaryAmount = exports.Measurements = exports.LocationIdentification = exports.LineItem = exports.InformationRequired = exports.PartiesAndInstruction = exports.ItemDescription = exports.Identity = exports.HierarchyInformation = exports.HandlingInstructions = exports.GeneralIndicator = exports.RelatedInformationNumbers = exports.GoodsIdentityNumber = exports.ProcessingInformation = exports.FreeText = exports.FinancialInstitutionInformation = exports.ApplicationErrorInformation = exports.EquipmentDetails = exports.AttachedEquipment = exports.ExternalFileLinkIdentification = exports.DateTimePeriod = exports.MessageDetails = exports.MessageSummary = exports.DeliveryLimitations = exports.DangerousGoods = exports.Currencies = exports.ContactInformation = exports.ConsignmentPackingSequence = exports.CommunicationContact = exports.ComponentDetails = exports.ControlTotal = exports.ComputerEnvironmentDetails = exports.CharacteristicClassID = exports.CharacteristicValue = exports.BusinessFunction = exports.BeginOfMessage = exports.AuthenticationResult = exports.MonetaryAmountFunction = exports.AdditionalPriceInformation = exports.AdditionalInformation = exports.AllowanceOrCharge = exports.AdjustmentDetails = exports.toSegmentObject = exports.sanitizeFloat = void 0;
|
|
exports.MessageTrailer = exports.SectionControl = exports.MessageHeader = exports.TransportServiceRequirements = exports.TermsOfDeliveryOrTransport = exports.TransportMovementDetails = exports.TransportInformationD11a = exports.TransportInformationD02b = exports.DetailsOfTransport = exports.TaxDetails = exports.Status = exports.SplitGoodsPlacement = exports.SequenceDetails = exports.SchedulingConditions = exports.SealNumber = exports.RateDetails = exports.RangeDetails = exports.AccountingJournalIdentification = exports.Reference = exports.RequirementsAndConditions = exports.QuantityVariances = exports.Quantity = exports.PaymentTerms = exports.PriceDetails = exports.AdditionalProductId = exports.ProductGroupInformation = exports.PackageIdentification = void 0;
|
|
function sanitizeFloat(str, decimalSymbol) {
|
|
const updatedStr = str.replace(decimalSymbol, ".");
|
|
return parseFloat(updatedStr);
|
|
}
|
|
exports.sanitizeFloat = sanitizeFloat;
|
|
function toSegmentObject(data, version, decimalSeparator) {
|
|
switch (data.name) {
|
|
case "AJT":
|
|
return new AdjustmentDetails(data);
|
|
case "ALC":
|
|
return new AllowanceOrCharge(data);
|
|
case "ALI":
|
|
return new AdditionalInformation(data);
|
|
case "APR":
|
|
return new AdditionalPriceInformation(data, decimalSeparator);
|
|
case "ARD":
|
|
return new MonetaryAmountFunction(data);
|
|
case "AUT":
|
|
return new AuthenticationResult(data);
|
|
case "BGM":
|
|
return new BeginOfMessage(data);
|
|
case "BUS":
|
|
return new BusinessFunction(data);
|
|
case "CAV":
|
|
return new CharacteristicValue(data);
|
|
case "CCI":
|
|
return new CharacteristicClassID(data);
|
|
case "CED":
|
|
return new ComputerEnvironmentDetails(data);
|
|
case "CNT":
|
|
return new ControlTotal(data, decimalSeparator);
|
|
case "COD":
|
|
return new ComponentDetails(data);
|
|
case "COM":
|
|
return new CommunicationContact(data);
|
|
case "CPS":
|
|
return new ConsignmentPackingSequence(data);
|
|
case "CTA":
|
|
return new ContactInformation(data);
|
|
case "CUX":
|
|
return new Currencies(data, decimalSeparator);
|
|
case "DGS":
|
|
return new DangerousGoods(data);
|
|
case "DLM":
|
|
return new DeliveryLimitations(data);
|
|
case "DMS":
|
|
return new MessageSummary(data);
|
|
case "DOC":
|
|
return new MessageDetails(data);
|
|
case "DTM":
|
|
return new DateTimePeriod(data);
|
|
case "EFI":
|
|
return new ExternalFileLinkIdentification(data);
|
|
case "EQA":
|
|
return new AttachedEquipment(data);
|
|
case "EQD":
|
|
return new EquipmentDetails(data);
|
|
case "ERC":
|
|
return new ApplicationErrorInformation(data);
|
|
case "FII":
|
|
return new FinancialInstitutionInformation(data);
|
|
case "FTX":
|
|
return new FreeText(data);
|
|
case "GEI":
|
|
return new ProcessingInformation(data);
|
|
case "GIN":
|
|
return new GoodsIdentityNumber(data);
|
|
case "GIR":
|
|
return new RelatedInformationNumbers(data);
|
|
case "GIS":
|
|
return new GeneralIndicator(data);
|
|
case "HAN":
|
|
return new HandlingInstructions(data);
|
|
case "HYN":
|
|
return new HierarchyInformation(data);
|
|
case "IDE":
|
|
return new Identity(data);
|
|
case "IMD":
|
|
return new ItemDescription(data);
|
|
case "INP":
|
|
return new PartiesAndInstruction(data);
|
|
case "IRQ":
|
|
return new InformationRequired(data);
|
|
case "LIN":
|
|
return new LineItem(data);
|
|
case "LOC":
|
|
return new LocationIdentification(data);
|
|
case "MEA":
|
|
return new Measurements(data);
|
|
case "MOA":
|
|
return new MonetaryAmount(data, decimalSeparator);
|
|
case "MTD":
|
|
return new MaintenanceOperationDetails(data);
|
|
case "NAD":
|
|
return new NameAndAddress(data);
|
|
case "PAC":
|
|
return new Package(data);
|
|
case "PAI":
|
|
return new PaymentInstructions(data);
|
|
case "PAT":
|
|
return new PaymentTermsBasis(data);
|
|
case "PCD":
|
|
return new PercentageDetails(data, decimalSeparator);
|
|
case "PCI":
|
|
return new PackageIdentification(data);
|
|
case "PGI":
|
|
return new ProductGroupInformation(data);
|
|
case "PIA":
|
|
return new AdditionalProductId(data);
|
|
case "PRI":
|
|
return new PriceDetails(data, decimalSeparator);
|
|
case "PYT":
|
|
return new PaymentTerms(data);
|
|
case "QTY":
|
|
return new Quantity(data);
|
|
case "QVR":
|
|
return new QuantityVariances(data, decimalSeparator);
|
|
case "RCS":
|
|
return new RequirementsAndConditions(data);
|
|
case "RFF":
|
|
return new Reference(data);
|
|
case "RJL":
|
|
return new AccountingJournalIdentification(data);
|
|
case "RNG":
|
|
return new RangeDetails(data, decimalSeparator);
|
|
case "RTE":
|
|
return new RateDetails(data, decimalSeparator);
|
|
case "SEL":
|
|
return new SealNumber(data);
|
|
case "SCC":
|
|
return new SchedulingConditions(data);
|
|
case "SEQ":
|
|
return new SequenceDetails(data);
|
|
case "SGP":
|
|
return new SplitGoodsPlacement(data);
|
|
case "STS":
|
|
return new Status(data);
|
|
case "TAX":
|
|
return new TaxDetails(data);
|
|
case "TDT":
|
|
const lversion = version.toLowerCase();
|
|
if (lversion === "d18b" || lversion === "d18a"
|
|
|| lversion === "d17b" || lversion === "d17a"
|
|
|| lversion === "d16b" || lversion === "d16a"
|
|
|| lversion === "d15b" || lversion === "d15a"
|
|
|| lversion === "d14b" || lversion === "d14a"
|
|
|| lversion === "d13b" || lversion === "d13a"
|
|
|| lversion === "d12b" || lversion === "d12a"
|
|
|| lversion === "d11b" || lversion === "d11a") {
|
|
return new TransportInformationD11a(data);
|
|
}
|
|
else if (version === "d10b" || version === "d10a"
|
|
|| lversion === "d09b" || lversion === "d09a"
|
|
|| lversion === "d08b" || lversion === "d08a"
|
|
|| lversion === "d07b" || lversion === "d07a"
|
|
|| lversion === "d06b" || lversion === "d06a"
|
|
|| lversion === "d05b" || lversion === "d05a"
|
|
|| lversion === "d04b" || lversion === "d04a"
|
|
|| lversion === "d03b" || lversion === "d03a"
|
|
|| lversion === "d02b" || lversion === "d02a") {
|
|
return new TransportInformationD02b(data);
|
|
}
|
|
else {
|
|
return new DetailsOfTransport(data);
|
|
}
|
|
case "TMD":
|
|
return new TransportMovementDetails(data);
|
|
case "TOD":
|
|
return new TermsOfDeliveryOrTransport(data);
|
|
case "TSR":
|
|
return new TransportServiceRequirements(data);
|
|
case "UNH":
|
|
return new MessageHeader(data);
|
|
case "UNS":
|
|
return new SectionControl(data);
|
|
case "UNT":
|
|
return new MessageTrailer(data);
|
|
default:
|
|
throw new Error(`Unsupported segment: ${data.name}`);
|
|
}
|
|
}
|
|
exports.toSegmentObject = toSegmentObject;
|
|
class AdjustmentDetails {
|
|
constructor(data) {
|
|
this.tag = "AJT";
|
|
this.adjustmentReasonDescriptionCode = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.lineItemIdentifier = data.elements[1][0];
|
|
}
|
|
}
|
|
}
|
|
exports.AdjustmentDetails = AdjustmentDetails;
|
|
class AllowanceOrChargeInformation {
|
|
constructor(data) {
|
|
this.allowanceOrChargeIdentifier = data[0];
|
|
this.allowanceOrChargeIdentificationCode = data[1];
|
|
}
|
|
}
|
|
class SpecialServicesIdentification {
|
|
constructor(data) {
|
|
this.specialServiceDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.specialServiceDescription = data[3];
|
|
this.specialServiceDescription2 = data[4];
|
|
}
|
|
}
|
|
class AllowanceOrCharge {
|
|
constructor(data) {
|
|
this.tag = "ALC";
|
|
this.allowanceOrChargeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.allowanceOrChargeInformation = new AllowanceOrChargeInformation(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.settlementMeansCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.calculationSequenceCode = data.elements[3][0];
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.specialServicesIdentification = new SpecialServicesIdentification(data.elements[4]);
|
|
}
|
|
}
|
|
}
|
|
exports.AllowanceOrCharge = AllowanceOrCharge;
|
|
class AdditionalInformation {
|
|
constructor(data) {
|
|
this.tag = "ALI";
|
|
if (data.elements.length > 0) {
|
|
this.countryOfOriginIdentifier = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.dutyRegimeTypeCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.specialConditionCode1 = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.specialConditionCode2 = data.elements[3][0];
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.specialConditionCode3 = data.elements[4][0];
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.specialConditionCode4 = data.elements[5][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.specialConditionCode5 = data.elements[6][0];
|
|
}
|
|
}
|
|
}
|
|
exports.AdditionalInformation = AdditionalInformation;
|
|
class PriceMultiplierInformation {
|
|
constructor(data, decimalSeparator) {
|
|
this.priceMuliplierRate = sanitizeFloat(data[0], decimalSeparator);
|
|
this.priceMuliplierTypeCodeQualifier = data[1];
|
|
}
|
|
}
|
|
class ReasonForChange {
|
|
constructor(data) {
|
|
this.changeReasonDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCoe = data[2];
|
|
this.changeReasonDescription = data[3];
|
|
}
|
|
}
|
|
class AdditionalPriceInformation {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "APR";
|
|
if (data.elements.length > 0) {
|
|
this.tradeClassCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.priceMultiplierInformation = new PriceMultiplierInformation(data.elements[1], decimalSeparator);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.reasonForChange = new ReasonForChange(data.elements[2]);
|
|
}
|
|
}
|
|
}
|
|
exports.AdditionalPriceInformation = AdditionalPriceInformation;
|
|
class MonetaryAmountFunctionData {
|
|
constructor(data) {
|
|
this.monetaryAmountFunctionDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.monetaryAmountFunctionDescription = data[3];
|
|
}
|
|
}
|
|
class MonetaryAmountFunctionDetail {
|
|
constructor(data) {
|
|
this.monetaryAmountFunctionDetailDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.monetaryAmountFunctionDetailDescription = data[3];
|
|
}
|
|
}
|
|
class MonetaryAmountFunction {
|
|
constructor(data) {
|
|
this.tag = "ARD";
|
|
if (data.elements.length > 0) {
|
|
this.monetaryAmountFunction = new MonetaryAmountFunctionData(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.monetaryAmountFunctionDetail = new MonetaryAmountFunctionDetail(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.MonetaryAmountFunction = MonetaryAmountFunction;
|
|
class AuthenticationResult {
|
|
constructor(data) {
|
|
this.tag = "AUT";
|
|
this.validationResultText = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.validationKeyIdentifier = data.elements[1][0];
|
|
}
|
|
}
|
|
}
|
|
exports.AuthenticationResult = AuthenticationResult;
|
|
class MessageName {
|
|
constructor(data) {
|
|
this.documentNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.documentName = data[3];
|
|
}
|
|
}
|
|
class MessageIdentification {
|
|
constructor(data) {
|
|
this.documentIdentifier = data[0];
|
|
this.versionIdentifier = data[1];
|
|
this.revisionIdentifier = data[2];
|
|
}
|
|
}
|
|
class BeginOfMessage {
|
|
constructor(data) {
|
|
this.tag = "BGM";
|
|
if (data.elements.length > 0) {
|
|
this.messageName = new MessageName(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.messageIdentification = new MessageIdentification(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.messageFunctionCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.responseTypeCode = data.elements[3][0];
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.documentStatusCode = data.elements[4][0];
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.languageNameCode = data.elements[5][0];
|
|
}
|
|
}
|
|
}
|
|
exports.BeginOfMessage = BeginOfMessage;
|
|
class BusinessFunctionData {
|
|
constructor(data) {
|
|
this.businessFunctionTypeCodeQualifier = data[0];
|
|
this.businessFunctionCode = data[1];
|
|
this.codeListIdentificationCode = data[2];
|
|
this.codeListResponsibleAgencyCode = data[3];
|
|
this.businessDescription = data[4];
|
|
}
|
|
}
|
|
class BankOperation {
|
|
constructor(data) {
|
|
this.bankOperationCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class BusinessFunction {
|
|
constructor(data) {
|
|
this.tag = "BUS";
|
|
if (data.elements.length > 0) {
|
|
this.businessFunction = new BusinessFunctionData(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.geographicAreaCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.financialTransactionTypeCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.bankOperation = new BankOperation(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.intraCompanyPaymentIndicatorCode = data.elements[4][0];
|
|
}
|
|
}
|
|
}
|
|
exports.BusinessFunction = BusinessFunction;
|
|
class CharacteristicValueData {
|
|
constructor(data) {
|
|
this.characteristicValueDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.characteristicValueDescription = data[3];
|
|
this.characteristicValueDescription2 = data[4];
|
|
}
|
|
}
|
|
class CharacteristicValue {
|
|
constructor(data) {
|
|
this.tag = "CAV";
|
|
this.characteristicValue = new CharacteristicValueData(data.elements[0]);
|
|
}
|
|
}
|
|
exports.CharacteristicValue = CharacteristicValue;
|
|
class CharacteristicDescription {
|
|
constructor(data) {
|
|
this.characteristicDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.characteristicDescription = data[3];
|
|
this.characteristicDescription2 = data[4];
|
|
}
|
|
}
|
|
class CharacteristicClassID {
|
|
constructor(data) {
|
|
this.tag = "CCI";
|
|
if (data.elements.length > 0) {
|
|
this.classTypeCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.measurementDetails = new MeasurementDetails(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.characteristicDescription = new CharacteristicDescription(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.characteristicRelevanceCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.CharacteristicClassID = CharacteristicClassID;
|
|
class ComputerEnviornmentIdentification {
|
|
constructor(data) {
|
|
this.computerEnvironmentNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.computerEnvironmentName = data[3];
|
|
this.versionIdentifier = data[4];
|
|
this.releaseIdentifier = data[5];
|
|
this.objectIdentifier = data[6];
|
|
}
|
|
}
|
|
class ComputerEnvironmentDetails {
|
|
constructor(data) {
|
|
this.tag = "CED";
|
|
this.computerEnvironmentDetailsCodeQualifier = data.elements[0][0];
|
|
this.computerEnviornmentIdentification = new ComputerEnviornmentIdentification(data.elements[1]);
|
|
if (data.elements.length > 3) {
|
|
this.fileGenerationCommandName = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.ComputerEnvironmentDetails = ComputerEnvironmentDetails;
|
|
class Control {
|
|
constructor(data, decimalSeparator) {
|
|
this.controlTotalTypeCodeQualifier = data[0];
|
|
this.controlTotalValue = sanitizeFloat(data[1], decimalSeparator);
|
|
this.measurementUnitCode = data[2];
|
|
}
|
|
}
|
|
class ControlTotal {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "CNT";
|
|
this.control = new Control(data.elements[0], decimalSeparator);
|
|
}
|
|
}
|
|
exports.ControlTotal = ControlTotal;
|
|
class TypeOfUnit {
|
|
constructor(data) {
|
|
this.unitOrComponentTypeDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.unitOrComponentTypeDescription = data[3];
|
|
}
|
|
}
|
|
class ComponentMaterial {
|
|
constructor(data) {
|
|
this.componentMaterialDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.componentMaterialDescription = data[3];
|
|
}
|
|
}
|
|
class ComponentDetails {
|
|
constructor(data) {
|
|
this.tag = "COD";
|
|
if (data.elements.length > 0) {
|
|
this.typeOfUnit = new TypeOfUnit(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.componentMaterial = new ComponentMaterial(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.ComponentDetails = ComponentDetails;
|
|
class CommunicationContactData {
|
|
constructor(data) {
|
|
this.communicationAddressIdentifier = data[0];
|
|
this.communicationAddressCodeQualifier = data[1];
|
|
}
|
|
}
|
|
class CommunicationContact {
|
|
constructor(data) {
|
|
this.tag = "COM";
|
|
this.communicationContact = new CommunicationContactData(data.elements[0]);
|
|
}
|
|
}
|
|
exports.CommunicationContact = CommunicationContact;
|
|
class ConsignmentPackingSequence {
|
|
constructor(data) {
|
|
this.tag = "CPS";
|
|
this.hierarchicalStructureLevelIdentifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.hierarchicalStructureParentIdentifier = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.packagingLevelCode = data.elements[2][0];
|
|
}
|
|
}
|
|
}
|
|
exports.ConsignmentPackingSequence = ConsignmentPackingSequence;
|
|
class DepartmentOrEmployeeDetails {
|
|
constructor(data) {
|
|
this.departmentOrEmployeeNameCode = data[0];
|
|
this.departmentOrEmployeeName = data[1];
|
|
}
|
|
}
|
|
class ContactInformation {
|
|
constructor(data) {
|
|
this.tag = "CTA";
|
|
if (data.elements.length > 0) {
|
|
this.contactFunctionCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.departmentOrEmployeeDetails = new DepartmentOrEmployeeDetails(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.ContactInformation = ContactInformation;
|
|
class CurrencyDetails {
|
|
constructor(data) {
|
|
this.currencyUsageCodeQualifier = data[0];
|
|
this.currencyIdentificationCode = data[1];
|
|
this.currencyTypeCodeQualifier = data[2];
|
|
if (data.length > 3) {
|
|
this.currencyRate = parseInt(data[3]);
|
|
}
|
|
}
|
|
}
|
|
class Currencies {
|
|
constructor(data, decimalSymbol) {
|
|
this.tag = "CUX";
|
|
if (data.elements.length > 0) {
|
|
this.currencyDetails1 = new CurrencyDetails(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.currencyDetails2 = new CurrencyDetails(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.currencyExchangeRate = sanitizeFloat(data.elements[2][0], decimalSymbol);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.exchangeRateCurrencyMarketIdentifier = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.Currencies = Currencies;
|
|
class HazardCode {
|
|
constructor(data) {
|
|
this.hazardIdentificationCode = data[0];
|
|
this.additionalHazardClassificationIdentifier = data[1];
|
|
this.hazardCodeVersionIdentifier = data[2];
|
|
}
|
|
}
|
|
class UnitedNationsDagneoursGoodsInformation {
|
|
constructor(data) {
|
|
if (data.length > 0) {
|
|
this.unitedNationsangerousGoodsIdentifier = parseInt(data[0]);
|
|
}
|
|
this.dangerousGoodsFlashpointValue = data[1];
|
|
}
|
|
}
|
|
class DangerousGoodsShipmentFlashpoint {
|
|
constructor(data) {
|
|
if (data.length > 0) {
|
|
this.shipmentFlashpointValue = parseInt(data[0]);
|
|
}
|
|
this.measurementUnitCode = data[1];
|
|
}
|
|
}
|
|
class HazardIdentificationPlacardDetails {
|
|
constructor(data) {
|
|
this.orangeHazardPlacardUpperPardIdentifier = data[0];
|
|
this.orangeHazardPlacardLowerPartIdentifier = data[1];
|
|
}
|
|
}
|
|
class DangerousGoodsLabel {
|
|
constructor(data) {
|
|
this.dangerousGoodsMarkingIdentifier1 = data[0];
|
|
this.dangerousGoodsMarkingIdentifier2 = data[1];
|
|
this.dangerousGoodsMarkingIdentifier3 = data[2];
|
|
}
|
|
}
|
|
class DangerousGoods {
|
|
constructor(data) {
|
|
this.tag = "DGS";
|
|
this.dangerousGoodsRegulationsCode = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.hazardCode = new HazardCode(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.undgInformation = new UnitedNationsDagneoursGoodsInformation(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.dangerousGoodsShipmentFlashpoint = new DangerousGoodsShipmentFlashpoint(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.packagingDangerLevelCode = data.elements[4][0];
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.emergencyProcedureForShipsIdentifier = data.elements[5][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.hazardMedicalFirstAidGuideIdentifier = data.elements[6][0];
|
|
}
|
|
if (data.elements.length > 7) {
|
|
this.transportEmergencyCardIdentifier = data.elements[7][0];
|
|
}
|
|
if (data.elements.length > 8) {
|
|
this.hazardIdentificationPlacardDetails = new HazardIdentificationPlacardDetails(data.elements[8]);
|
|
}
|
|
if (data.elements.length > 9) {
|
|
this.dangerousGoodsLabel = new DangerousGoodsLabel(data.elements[9]);
|
|
}
|
|
if (data.elements.length > 10) {
|
|
this.packingInstructionTypeCode = data.elements[10][0];
|
|
}
|
|
if (data.elements.length > 11) {
|
|
this.hazardousMeansOfTransportCategoryCode = data.elements[11][0];
|
|
}
|
|
if (data.elements.length > 12) {
|
|
this.hazardousCargoTransportAuthorizationCode = data.elements[12][0];
|
|
}
|
|
}
|
|
}
|
|
exports.DangerousGoods = DangerousGoods;
|
|
class DeliveryLimitations {
|
|
constructor(data) {
|
|
this.tag = "DLM";
|
|
if (data.elements.length > 0) {
|
|
this.backOrderArrangementTypeCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.instruction = new Instruction(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.specialServicesIdentification = new SpecialServicesIdentification(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.substitutionConditionCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.DeliveryLimitations = DeliveryLimitations;
|
|
class MessageSummary {
|
|
constructor(data) {
|
|
this.tag = "DMS";
|
|
if (data.elements.length > 0) {
|
|
this.messageIdentification = new MessageIdentification(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.messageName = new MessageName(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.itemTotalQuantity = parseInt(data.elements[2][0]);
|
|
}
|
|
}
|
|
}
|
|
exports.MessageSummary = MessageSummary;
|
|
class MessageDetailsData {
|
|
constructor(data) {
|
|
this.documentIdentifer = data[0];
|
|
this.documentStatusCode = data[1];
|
|
this.documentSourceDescription = data[2];
|
|
this.languageNameCode = data[3];
|
|
this.versionIdentifier = data[4];
|
|
this.revisionIdentifier = data[5];
|
|
}
|
|
}
|
|
class MessageDetails {
|
|
constructor(data) {
|
|
this.tag = "DOC";
|
|
this.messageName = new MessageName(data.elements[0]);
|
|
if (data.elements.length > 1) {
|
|
this.messageDetails = new MessageDetailsData(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.communicationMediumTypeCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.documentCopiesRequiredQuantity = parseInt(data.elements[3][0]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.doucmentOriginalsRequiredQuantity = parseInt(data.elements[4][0]);
|
|
}
|
|
}
|
|
}
|
|
exports.MessageDetails = MessageDetails;
|
|
class DateTimePeriod {
|
|
constructor(data) {
|
|
this.tag = "DTM";
|
|
this.dateTimeOrPeriodFunctionCodeQualifier = data.elements[0][0];
|
|
if (data.elements[0].length > 1) {
|
|
this.dateTimeOrPeriodText = data.elements[0][1];
|
|
}
|
|
if (data.elements[0].length > 2) {
|
|
this.dateTimeOrPeriodFormatCode = data.elements[0][2];
|
|
}
|
|
}
|
|
}
|
|
exports.DateTimePeriod = DateTimePeriod;
|
|
class FileIdentification {
|
|
constructor(data) {
|
|
this.fileName = data[0];
|
|
this.itemDescription = data[1];
|
|
}
|
|
}
|
|
class FileDetails {
|
|
constructor(data) {
|
|
this.fileFormatName = data[0];
|
|
this.versionIdentifier = data[1];
|
|
this.dataFormatDescriptionCode = data[2];
|
|
this.dataFormatDescription = data[3];
|
|
}
|
|
}
|
|
class ExternalFileLinkIdentification {
|
|
constructor(data) {
|
|
this.tag = "EFI";
|
|
this.fileIdentification = new FileIdentification(data.elements[0]);
|
|
if (data.elements.length > 1) {
|
|
this.fileDetails = new FileDetails(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.sequencePositionIdentifier = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.fileCompressionTechniqueName = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.ExternalFileLinkIdentification = ExternalFileLinkIdentification;
|
|
class AttachedEquipment {
|
|
constructor(data) {
|
|
this.tag = "EQA";
|
|
this.equipmentTypeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.equipmentIdentification = new EquipmentIdentification(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.AttachedEquipment = AttachedEquipment;
|
|
class EquipmentIdentification {
|
|
constructor(data) {
|
|
this.equipmentIdentifier = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.countryNameCode = data[3];
|
|
}
|
|
}
|
|
class EquipmentSizeAndType {
|
|
constructor(data) {
|
|
this.equipmentSizeAndTypeDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.equipmentSizeAndTypeDescription = data[3];
|
|
}
|
|
}
|
|
class EquipmentDetails {
|
|
constructor(data) {
|
|
this.tag = "EQD";
|
|
this.equipmentTypeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.equipmentIdentification = new EquipmentIdentification(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.equipmentSizeAndType = new EquipmentSizeAndType(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.equipmentSupplierCode = data.elements[3][0];
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.equipmentStatusCode = data.elements[4][0];
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.fullOrEmptyIndicatorCode = data.elements[5][0];
|
|
}
|
|
}
|
|
}
|
|
exports.EquipmentDetails = EquipmentDetails;
|
|
class ApplicationErrorDetail {
|
|
constructor(data) {
|
|
this.applicationErrorCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class ApplicationErrorInformation {
|
|
constructor(data) {
|
|
this.tag = "ERC";
|
|
this.applicationErrorDetail = new ApplicationErrorDetail(data.elements[0]);
|
|
}
|
|
}
|
|
exports.ApplicationErrorInformation = ApplicationErrorInformation;
|
|
class AccountHolderIdentification {
|
|
constructor(data) {
|
|
this.accountHolderIdentifier = data[0];
|
|
this.accountHolderName = data[1];
|
|
this.accountHolderName2 = data[2];
|
|
this.currencyIdentificationCode = data[3];
|
|
}
|
|
}
|
|
class InstitutionIdentification {
|
|
constructor(data) {
|
|
this.institutionNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.institutionBranchIdentifier = data[3];
|
|
this.codeListIdentificationCode2 = data[4];
|
|
this.codeListResponsibleAgencyCode2 = data[5];
|
|
this.institutionName = data[6];
|
|
this.institutionBranchLocationName = data[7];
|
|
}
|
|
}
|
|
class FinancialInstitutionInformation {
|
|
constructor(data) {
|
|
this.tag = "FII";
|
|
this.partyFunctionCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.accountHolderIdentification = new AccountHolderIdentification(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.institutionIdentification = new InstitutionIdentification(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.countryNameCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.FinancialInstitutionInformation = FinancialInstitutionInformation;
|
|
class TextReference {
|
|
constructor(data) {
|
|
this.freeTextValueCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class TextLiteral {
|
|
constructor(data) {
|
|
this.freeTextValue1 = data[0];
|
|
this.freeTextValue2 = data[1];
|
|
this.freeTextValue3 = data[2];
|
|
this.freeTextValue4 = data[3];
|
|
this.freeTextValue5 = data[4];
|
|
}
|
|
}
|
|
class FreeText {
|
|
constructor(data) {
|
|
this.tag = "FTX";
|
|
this.textSubjectCodeQualifier = data.elements[0][0];
|
|
this.freeTextFunctionCode = data.elements[1][0];
|
|
if (data.elements.length > 2) {
|
|
this.textReference = new TextReference(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.textLiteral = new TextLiteral(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.languageNameCode = data.elements[4][0];
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.freeTextFormatCode = data.elements[5][0];
|
|
}
|
|
}
|
|
}
|
|
exports.FreeText = FreeText;
|
|
class ProcessingIndicator {
|
|
constructor(data) {
|
|
this.processingIndicatorDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.processTypeDescriptionCode = data[3];
|
|
}
|
|
}
|
|
class ProcessingInformation {
|
|
constructor(data) {
|
|
this.tag = "GEI";
|
|
this.processingInformationCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.processingIndicator = new ProcessingIndicator(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.processTypeDescriptionCode = data.elements[2][0];
|
|
}
|
|
}
|
|
}
|
|
exports.ProcessingInformation = ProcessingInformation;
|
|
class IdentityNumberRange {
|
|
constructor(data) {
|
|
this.objectIdentifier1 = data[0];
|
|
this.objectIdentifier2 = data[1];
|
|
}
|
|
}
|
|
class GoodsIdentityNumber {
|
|
constructor(data) {
|
|
this.tag = "GIN";
|
|
this.objectIdentificationCodeQualifier = data.elements[0][0];
|
|
this.identityNumberRange1 = new IdentityNumberRange(data.elements[1]);
|
|
if (data.elements.length > 2) {
|
|
this.identityNumberRange2 = new IdentityNumberRange(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.identityNumberRange3 = new IdentityNumberRange(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.identityNumberRange4 = new IdentityNumberRange(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.identityNumberRange5 = new IdentityNumberRange(data.elements[5]);
|
|
}
|
|
}
|
|
}
|
|
exports.GoodsIdentityNumber = GoodsIdentityNumber;
|
|
class IdentificationNumber {
|
|
constructor(data) {
|
|
this.objectIdentifier = data[0];
|
|
this.objectIdentificationCodeQualifier = data[1];
|
|
this.statusDescriptionCode = data[2];
|
|
}
|
|
}
|
|
class RelatedInformationNumbers {
|
|
constructor(data) {
|
|
this.tag = "GIR";
|
|
this.setTypeCodeQualifier = data.elements[0][0];
|
|
this.identificationNumber1 = new IdentificationNumber(data.elements[1]);
|
|
if (data.elements.length > 2) {
|
|
this.identificationNumber2 = new IdentificationNumber(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.identificationNumber3 = new IdentificationNumber(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.identificationNumber4 = new IdentificationNumber(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.identificationNumber5 = new IdentificationNumber(data.elements[5]);
|
|
}
|
|
}
|
|
}
|
|
exports.RelatedInformationNumbers = RelatedInformationNumbers;
|
|
class GeneralIndicator {
|
|
constructor(data) {
|
|
this.tag = "GIS";
|
|
this.processingIndicator = new ProcessingIndicator(data.elements[0]);
|
|
}
|
|
}
|
|
exports.GeneralIndicator = GeneralIndicator;
|
|
class HandlingInstructionsData {
|
|
constructor(data) {
|
|
this.handlingInstructionDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.handlingInstructionDescription = data[3];
|
|
}
|
|
}
|
|
class HazardousMaterial {
|
|
constructor(data) {
|
|
this.hazardousMaterialCategoryNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.hazardousMaterialCategoryName = data[3];
|
|
}
|
|
}
|
|
class HandlingInstructions {
|
|
constructor(data) {
|
|
this.tag = "HAN";
|
|
if (data.elements.length > 0) {
|
|
this.handlingInstructions = new HandlingInstructionsData(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.hazardousMaterial = new HazardousMaterial(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.HandlingInstructions = HandlingInstructions;
|
|
class HierarchyInformation {
|
|
constructor(data) {
|
|
this.tag = "HYN";
|
|
this.hierarchyObjectCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.hierarchicalStructureRelationshipCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.actionCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.itemNumberIdentification = new ItemNumberIdentification(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.hierarchicalStructureParentIdentifier = data.elements[4][0];
|
|
}
|
|
}
|
|
}
|
|
exports.HierarchyInformation = HierarchyInformation;
|
|
class PositionIdentification {
|
|
constructor(data) {
|
|
this.hierarchicalStructureLevelIdentifier = data[0];
|
|
this.sequencePositionIdentifier = data[1];
|
|
}
|
|
}
|
|
class Identity {
|
|
constructor(data) {
|
|
this.tag = "IDE";
|
|
this.objectTypeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.identificationNumber = new IdentificationNumber(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.partyIdentificationDetails = new PartyIdentificationDetails(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.statusDescriptionCode = data.elements[3][0];
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.configurationLevelNumber = parseInt(data.elements[4][0]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.positionIdentification = new PositionIdentification(data.elements[5]);
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.characteristicDescription = new CharacteristicDescription(data.elements[6]);
|
|
}
|
|
}
|
|
}
|
|
exports.Identity = Identity;
|
|
class ItemCharacteristic {
|
|
constructor(data) {
|
|
this.itemCharacteristicCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class ItemDescriptionData {
|
|
constructor(data) {
|
|
this.itemDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.itemDescription = data[3];
|
|
this.itemDescription2 = data[4];
|
|
this.languageNameCode = data[5];
|
|
}
|
|
}
|
|
class ItemDescription {
|
|
constructor(data) {
|
|
this.tag = "IMD";
|
|
if (data.elements.length > 0) {
|
|
this.descriptionFormatCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.itemCharacteristic = new ItemCharacteristic(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.itemDescription = new ItemDescriptionData(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.surfaceOrLayerCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.ItemDescription = ItemDescription;
|
|
class PartiesToInstruction {
|
|
constructor(data) {
|
|
this.enactingPartyIdentifier = data[0];
|
|
this.instructionReceivingPartyIdentifier = data[1];
|
|
}
|
|
}
|
|
class Instruction {
|
|
constructor(data) {
|
|
this.instructionTypeCodeQualifier = data[0];
|
|
this.instructionDescriptionCode = data[1];
|
|
this.codeListIdentificationCode = data[2];
|
|
this.codeListResponsibleAgencyCode = data[3];
|
|
this.instructionDescription = data[4];
|
|
}
|
|
}
|
|
class StatusOfInstruction {
|
|
constructor(data) {
|
|
this.statusDescriptionCode = data[0];
|
|
this.partyName = data[1];
|
|
}
|
|
}
|
|
class PartiesAndInstruction {
|
|
constructor(data) {
|
|
this.tag = "INP";
|
|
if (data.elements.length > 0) {
|
|
this.partiesToInstruction = new PartiesToInstruction(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.instruction = new Instruction(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.statusOfInstruction = new StatusOfInstruction(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.actionRequestNotificationDescriptionCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.PartiesAndInstruction = PartiesAndInstruction;
|
|
class InformationRequest {
|
|
constructor(data) {
|
|
this.requestInformationDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.requestInformationDescription = data[3];
|
|
}
|
|
}
|
|
class InformationRequired {
|
|
constructor(data) {
|
|
this.tag = "IRQ";
|
|
this.informationRequest = new InformationRequest(data.elements[0]);
|
|
}
|
|
}
|
|
exports.InformationRequired = InformationRequired;
|
|
class ItemNumberIdentification {
|
|
constructor(data) {
|
|
this.itemIdentifier = data[0];
|
|
this.itemTypeIdentificationCode = data[1];
|
|
this.codeListIdentificationCode = data[2];
|
|
this.codeListResponsibleAgencyCode = data[3];
|
|
}
|
|
}
|
|
class SubLineInformation {
|
|
constructor(data) {
|
|
this.subLineIndicatorCode = data[0];
|
|
this.lineItemIdentifier = data[1];
|
|
}
|
|
}
|
|
class LineItem {
|
|
constructor(data) {
|
|
this.tag = "LIN";
|
|
if (data.elements.length > 0) {
|
|
this.lineItemIdendifier = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.actionRequestNotificationDescriptionCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.itemNumberIdentification = new ItemNumberIdentification(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.subLineInformatin = new SubLineInformation(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.configurationLevelNumber = parseInt(data.elements[4][0]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.configurationOperationCode = data.elements[5][0];
|
|
}
|
|
}
|
|
}
|
|
exports.LineItem = LineItem;
|
|
class LocationIdentificationData {
|
|
constructor(data) {
|
|
this.locationNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.locationName = data[3];
|
|
}
|
|
}
|
|
class RelatedLocationOneIdentification {
|
|
constructor(data) {
|
|
this.firstRelatedLocationNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.firstRelatedLocationName = data[3];
|
|
}
|
|
}
|
|
class RelatedLocationTwoIdentification {
|
|
constructor(data) {
|
|
this.secondRelatedLocationNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.secondRelatedLocationName = data[3];
|
|
}
|
|
}
|
|
class LocationIdentification {
|
|
constructor(data) {
|
|
this.tag = "LOC";
|
|
this.locationFunctionCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.locationIdentification = new LocationIdentificationData(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.relatedLocationOneIdentification = new RelatedLocationOneIdentification(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.relatedLocationTwoIdentification = new RelatedLocationTwoIdentification(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.relationCode = data.elements[4][0];
|
|
}
|
|
}
|
|
}
|
|
exports.LocationIdentification = LocationIdentification;
|
|
class MeasurementDetails {
|
|
constructor(data) {
|
|
this.measuredAttributeCode = data[0];
|
|
this.measurementSignificanceCode = data[1];
|
|
this.nonDiscreteMeasurementNameCode = data[2];
|
|
this.nonDiscreteMeasurementName = data[3];
|
|
}
|
|
}
|
|
class ValueRange {
|
|
constructor(data) {
|
|
this.measurementUnitCode = data[0];
|
|
this.measure = data[1];
|
|
if (data.length > 2) {
|
|
this.rangeMinimumQuantity = parseInt(data[2]);
|
|
}
|
|
if (data.length > 3) {
|
|
this.rangeMaximumQuantity = parseInt(data[3]);
|
|
}
|
|
if (data.length > 4) {
|
|
this.significantDigitsQuantity = parseInt(data[4]);
|
|
}
|
|
}
|
|
}
|
|
class Measurements {
|
|
constructor(data) {
|
|
this.tag = "MEA";
|
|
this.measurementPurposeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.measurementDetails = new MeasurementDetails(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.valueRange = new ValueRange(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.surfaceOrLayerCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.Measurements = Measurements;
|
|
class MonetaryAmountData {
|
|
constructor(data, decimalSeparator) {
|
|
this.monetaryAmountTypeCodeQualifier = data[0];
|
|
if (data.length > 1) {
|
|
this.monetaryAmount = sanitizeFloat(data[1], decimalSeparator);
|
|
}
|
|
this.currencyIdentificationCode = data[2];
|
|
this.currencyTypeCodeQualifier = data[3];
|
|
this.statusDescriptionCode = data[4];
|
|
}
|
|
}
|
|
class MonetaryAmount {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "MOA";
|
|
this.monetaryAmount = new MonetaryAmountData(data.elements[0], decimalSeparator);
|
|
}
|
|
}
|
|
exports.MonetaryAmount = MonetaryAmount;
|
|
class MaintenanceOperationDetails {
|
|
constructor(data) {
|
|
this.tag = "MTD";
|
|
this.objectTypeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.maintenanceOperationCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.maintenanceOperationOperatorCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.maintenanceOperationPayerCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.MaintenanceOperationDetails = MaintenanceOperationDetails;
|
|
class PartyIdentificationDetails {
|
|
constructor(data) {
|
|
this.partyIdentifier = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class NameAndAddressData {
|
|
constructor(data) {
|
|
this.nameAndAddressDescription1 = data[0];
|
|
this.nameAndAddressDescription2 = data[1];
|
|
this.nameAndAddressDescription3 = data[2];
|
|
this.nameAndAddressDescription4 = data[3];
|
|
this.nameAndAddressDescription5 = data[4];
|
|
}
|
|
}
|
|
class PartyName {
|
|
constructor(data) {
|
|
this.partyName1 = data[0];
|
|
this.partyName2 = data[1];
|
|
this.partyName3 = data[2];
|
|
this.partyName4 = data[3];
|
|
this.partyName5 = data[4];
|
|
this.partyNameFormatCode = data[5];
|
|
}
|
|
}
|
|
class Street {
|
|
constructor(data) {
|
|
this.streetAndNumberOrPostOfficeBoxIdentifier1 = data[0];
|
|
this.streetAndNumberOrPostOfficeBoxIdentifier2 = data[0];
|
|
this.streetAndNumberOrPostOfficeBoxIdentifier3 = data[0];
|
|
this.streetAndNumberOrPostOfficeBoxIdentifier4 = data[0];
|
|
}
|
|
}
|
|
class CountrySubEntityDetails {
|
|
constructor(data) {
|
|
this.countrySubEntityNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.countrySubEntityName = data[3];
|
|
}
|
|
}
|
|
class NameAndAddress {
|
|
constructor(data) {
|
|
this.tag = "NAD";
|
|
this.partyFunctionCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.partyIdentificationDetails = new PartyIdentificationDetails(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.nameAndAddress = new NameAndAddressData(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.partyName = new PartyName(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.street = new Street(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.cityName = data.elements[5][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.countrySubEntityDetails = new CountrySubEntityDetails(data.elements[6]);
|
|
}
|
|
if (data.elements.length > 7) {
|
|
this.postalIdentificationCode = data.elements[7][0];
|
|
}
|
|
if (data.elements.length > 8) {
|
|
this.countryNameCode = data.elements[8][0];
|
|
}
|
|
}
|
|
}
|
|
exports.NameAndAddress = NameAndAddress;
|
|
class PackagingDetails {
|
|
constructor(data) {
|
|
this.packagingLevelCode = data[0];
|
|
this.packagingRelatedDescriptionCode = data[1];
|
|
this.packagingTermsAndConditionsCode = data[2];
|
|
}
|
|
}
|
|
class PackageType {
|
|
constructor(data) {
|
|
this.packageTypeDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.typeOfPackages = data[3];
|
|
}
|
|
}
|
|
class PackageTypeIdentification {
|
|
constructor(data) {
|
|
this.descriptionFormatCode = data[0];
|
|
this.typeOfPackages = data[1];
|
|
this.itemTypeIdentificationCode = data[2];
|
|
this.typeOfPackages2 = data[3];
|
|
this.itemTypeIdentificationCode2 = data[4];
|
|
}
|
|
}
|
|
class ReturnablePackageDetails {
|
|
constructor(data) {
|
|
this.returnablePackageFreightPaymentResponsibilityCode = data[0];
|
|
this.returnablePackageLoadContentsCode = data[1];
|
|
}
|
|
}
|
|
class Package {
|
|
constructor(data) {
|
|
this.tag = "PAC";
|
|
if (data.elements.length > 0) {
|
|
this.packageQuantity = parseInt(data.elements[0][0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.packagingDetails = new PackagingDetails(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.packageType = new PackageType(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.packageTypeIdentification = new PackageTypeIdentification(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.returnablePackageDetails = new ReturnablePackageDetails(data.elements[4]);
|
|
}
|
|
}
|
|
}
|
|
exports.Package = Package;
|
|
class PaymentInstructions {
|
|
constructor(data) {
|
|
this.tag = "PAI";
|
|
if (data.elements.length > 1) {
|
|
this.paymendConditionsCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.paymentGuaranteeMeansCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.paymentMeansCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.codeListIdentificatinCode = data.elements[3][0];
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.codeListResponsibleAgencyCode = data.elements[4][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.paymentChannelCode = data.elements[5][0];
|
|
}
|
|
}
|
|
}
|
|
exports.PaymentInstructions = PaymentInstructions;
|
|
class PATPaymentTerms {
|
|
constructor(data) {
|
|
this.paymentTermsDescriptionIdentifier = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.paymentTermsDescription1 = data[3];
|
|
this.paymentTermsDescription2 = data[4];
|
|
}
|
|
}
|
|
class TermsTimeInformation {
|
|
constructor(data) {
|
|
this.timeReferenceCode = data[0];
|
|
this.termsTimeRelationCode = data[1];
|
|
this.periodTypeCode = data[2];
|
|
if (data.length > 3) {
|
|
this.periodCountQuality = parseInt(data[3]);
|
|
}
|
|
}
|
|
}
|
|
class PaymentTermsBasis {
|
|
constructor(data) {
|
|
this.tag = "PAT";
|
|
this.paymentTermsTypeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.paymentTerms = new PATPaymentTerms(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.termsTimeInformation = new TermsTimeInformation(data.elements[2]);
|
|
}
|
|
}
|
|
}
|
|
exports.PaymentTermsBasis = PaymentTermsBasis;
|
|
class PercentageDetailsData {
|
|
constructor(data, decimalSeparator) {
|
|
this.percentageTypeCodeQualifier = data[0];
|
|
if (data.length > 1) {
|
|
this.percentage = sanitizeFloat(data[1], decimalSeparator);
|
|
}
|
|
this.percentageBasisIdentificationCode = data[2];
|
|
this.codeListIdentificationCode = data[3];
|
|
this.codeListResponsibleAgencyCode = data[4];
|
|
}
|
|
}
|
|
class PercentageDetails {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "PCD";
|
|
this.percentageDetails = new PercentageDetailsData(data.elements[0], decimalSeparator);
|
|
if (data.elements.length > 1) {
|
|
this.statusDescriptionCode = data.elements[1][0];
|
|
}
|
|
}
|
|
}
|
|
exports.PercentageDetails = PercentageDetails;
|
|
class MarksAndLabels {
|
|
constructor(data) {
|
|
this.shippingMarksDescription1 = data[0];
|
|
this.shippingMarksDescription2 = data[1];
|
|
this.shippingMarksDescription3 = data[2];
|
|
this.shippingMarksDescription4 = data[3];
|
|
this.shippingMarksDescription5 = data[4];
|
|
this.shippingMarksDescription6 = data[5];
|
|
this.shippingMarksDescription7 = data[6];
|
|
this.shippingMarksDescription8 = data[7];
|
|
this.shippingMarksDescription9 = data[8];
|
|
this.shippingMarksDescription10 = data[9];
|
|
}
|
|
}
|
|
class TypeOfMarking {
|
|
constructor(data) {
|
|
this.markingTypeCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class PackageIdentification {
|
|
constructor(data) {
|
|
this.tag = "PCI";
|
|
this.markingInstructionCode = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.marksAndLabels = new MarksAndLabels(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.containerOrPackageContentsIndicatorCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.typeOfMarking = new TypeOfMarking(data.elements[3]);
|
|
}
|
|
}
|
|
}
|
|
exports.PackageIdentification = PackageIdentification;
|
|
class ProductGroup {
|
|
constructor(data) {
|
|
this.productGroupNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.productGroupName = data[3];
|
|
}
|
|
}
|
|
class ProductGroupInformation {
|
|
constructor(data) {
|
|
this.tag = "PGI";
|
|
this.productGroupTypeCode = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.productGroup = new ProductGroup(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.ProductGroupInformation = ProductGroupInformation;
|
|
class AdditionalProductId {
|
|
constructor(data) {
|
|
this.tag = "PIA";
|
|
this.productIdentifierCodeQualifier = data.elements[0][0];
|
|
this.itemNumberIdentification1 = new ItemNumberIdentification(data.elements[1]);
|
|
if (data.elements.length > 2) {
|
|
this.itemNumberIdentification2 = new ItemNumberIdentification(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.itemNumberIdentification3 = new ItemNumberIdentification(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.itemNumberIdentification4 = new ItemNumberIdentification(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.itemNumberIdentification5 = new ItemNumberIdentification(data.elements[5]);
|
|
}
|
|
}
|
|
}
|
|
exports.AdditionalProductId = AdditionalProductId;
|
|
class PriceInformation {
|
|
constructor(data, decimalSeparator) {
|
|
this.priceCodeQualifier = data[0];
|
|
if (data.length > 1) {
|
|
this.priceAmount = sanitizeFloat(data[1], decimalSeparator);
|
|
}
|
|
this.priceTypeCode = data[2];
|
|
this.priceSpecificationCode = data[3];
|
|
if (data.length > 4) {
|
|
this.unitPriceBasisValue = sanitizeFloat(data[4], decimalSeparator);
|
|
}
|
|
this.measurementUnitCode = data[5];
|
|
}
|
|
}
|
|
class PriceDetails {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "PRI";
|
|
if (data.elements.length > 0) {
|
|
this.priceInformation = new PriceInformation(data.elements[0], decimalSeparator);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.subLineItemPriceChangeOperationCode = data.elements[1][0];
|
|
}
|
|
}
|
|
}
|
|
exports.PriceDetails = PriceDetails;
|
|
class PaymentTermsData {
|
|
constructor(data) {
|
|
this.paymentTermsDescriptionIdentifier = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.paymentTermsDescription = data[3];
|
|
}
|
|
}
|
|
class PaymentTerms {
|
|
constructor(data) {
|
|
this.tag = "PYT";
|
|
this.paymentTermsTypeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.paymentTerms = new PaymentTermsData(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.eventTimeReferenceCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.termsTimeRelationCode = data.elements[3][0];
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.periodTypeCode = data.elements[4][0];
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.periodCountQuantity = parseInt(data.elements[5][0]);
|
|
}
|
|
}
|
|
}
|
|
exports.PaymentTerms = PaymentTerms;
|
|
class QuantityDetails {
|
|
constructor(data) {
|
|
this.quantityTypeCodeQualifier = data[0];
|
|
this.quantity = data[1];
|
|
this.measurementUnitCode = data[2];
|
|
}
|
|
}
|
|
class Quantity {
|
|
constructor(data) {
|
|
this.tag = "QTY";
|
|
this.quantityDetails = new QuantityDetails(data.elements[0]);
|
|
}
|
|
}
|
|
exports.Quantity = Quantity;
|
|
class QuantityDifferenceInformation {
|
|
constructor(data, decimalSeparator) {
|
|
this.varianceQuantity = sanitizeFloat(data[0], decimalSeparator);
|
|
this.quantityTypeCodeQualifier = data[1];
|
|
}
|
|
}
|
|
class QuantityVariances {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "QVR";
|
|
if (data.elements.length > 0) {
|
|
this.quantityDifferenceInformation = new QuantityDifferenceInformation(data.elements[0], decimalSeparator);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.discrepancyNatureIdentificationCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.reasonForChange = new ReasonForChange(data.elements[2]);
|
|
}
|
|
}
|
|
}
|
|
exports.QuantityVariances = QuantityVariances;
|
|
class RequirementOrConditionIdentification {
|
|
constructor(data) {
|
|
this.requirementOrConditionDescriptionIdentifier = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.requirementOrConditionDescription = data[3];
|
|
}
|
|
}
|
|
class RequirementsAndConditions {
|
|
constructor(data) {
|
|
this.tag = "RCS";
|
|
this.sectorAreaIdentificationCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.requirementOrConditionIdentification = new RequirementOrConditionIdentification(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.actionRequestNotificationDescriptionCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.countryNameCode = data.elements[3][0];
|
|
}
|
|
}
|
|
}
|
|
exports.RequirementsAndConditions = RequirementsAndConditions;
|
|
class ReferenceData {
|
|
constructor(data) {
|
|
this.referenceCodeQualifier = data[0];
|
|
this.referenceIdentifier = data[1];
|
|
this.documentLineIdentifier = data[2];
|
|
this.referenceVersionIdentifier = data[3];
|
|
this.revisionIdentifier = data[4];
|
|
}
|
|
}
|
|
class Reference {
|
|
constructor(data) {
|
|
this.tag = "RFF";
|
|
this.reference = new ReferenceData(data.elements[0]);
|
|
}
|
|
}
|
|
exports.Reference = Reference;
|
|
class AccountingJournalIdentificationData {
|
|
constructor(data) {
|
|
this.accountingJournalIdentification = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.accountingJournalName = data[3];
|
|
}
|
|
}
|
|
class AccountingEntryTypeDetails {
|
|
constructor(data) {
|
|
this.accountingEntryTypeNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.accountingEntryTypeName = data[3];
|
|
}
|
|
}
|
|
class AccountingJournalIdentification {
|
|
constructor(data) {
|
|
this.tag = "RJL";
|
|
if (data.elements.length > 0) {
|
|
this.accountingJournalIdentification = new AccountingJournalIdentificationData(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.accountingEntryTypeDetails = new AccountingEntryTypeDetails(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.AccountingJournalIdentification = AccountingJournalIdentification;
|
|
class Range {
|
|
constructor(data, decimalSeparator) {
|
|
this.measurementUnitCode = data[0];
|
|
this.rangeMinimumValue = sanitizeFloat(data[1], decimalSeparator);
|
|
this.rangeMaximumValue = sanitizeFloat(data[2], decimalSeparator);
|
|
}
|
|
}
|
|
class RangeDetails {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "RNG";
|
|
this.rangeTypeCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.range = new Range(data.elements[1], decimalSeparator);
|
|
}
|
|
}
|
|
}
|
|
exports.RangeDetails = RangeDetails;
|
|
class RateDetailsData {
|
|
constructor(data, decimalSeparator) {
|
|
this.rateTypeCodeQualifier = data[0];
|
|
this.unitPriceBasisRate = sanitizeFloat(data[1], decimalSeparator);
|
|
this.unitPriceBasisValue = sanitizeFloat(data[2], decimalSeparator);
|
|
this.measurementUnitCode = data[3];
|
|
}
|
|
}
|
|
class RateDetails {
|
|
constructor(data, decimalSeparator) {
|
|
this.tag = "RTE";
|
|
this.rateDetails = new RateDetailsData(data.elements[0], decimalSeparator);
|
|
if (data.elements.length > 1) {
|
|
this.statusDescriptionCode = data.elements[1][0];
|
|
}
|
|
}
|
|
}
|
|
exports.RateDetails = RateDetails;
|
|
class SealIssuer {
|
|
constructor(data) {
|
|
this.sealingPartyNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.sealingPartyName = data[3];
|
|
}
|
|
}
|
|
class SealNumber {
|
|
constructor(data) {
|
|
this.tag = "SEL";
|
|
this.sealIdentifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.sealIssuer = new SealIssuer(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.sealConditionCode = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.identityNumberRange = new IdentityNumberRange(data.elements[3]);
|
|
}
|
|
}
|
|
}
|
|
exports.SealNumber = SealNumber;
|
|
class PatternDescription {
|
|
constructor(data) {
|
|
this.frequencyCode = data[0];
|
|
this.despatchPatternCode = data[1];
|
|
this.despatchPatternTimingCode = data[2];
|
|
}
|
|
}
|
|
class SchedulingConditions {
|
|
constructor(data) {
|
|
this.tag = "SCC";
|
|
this.deliveryPlanCommitmentLevelCode = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.deliveryInstructionCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.patternDescription = new PatternDescription(data.elements[2]);
|
|
}
|
|
}
|
|
}
|
|
exports.SchedulingConditions = SchedulingConditions;
|
|
class SequenceInformation {
|
|
constructor(data) {
|
|
this.sequencePositionIdentifier = data[0];
|
|
this.sequenceIdentifierSoruceCode = data[1];
|
|
this.codeListIdentificationCode = data[2];
|
|
this.codeListResponsibleAgencyCode = data[3];
|
|
}
|
|
}
|
|
class SequenceDetails {
|
|
constructor(data) {
|
|
this.tag = "SEQ";
|
|
if (data.elements.length > 0) {
|
|
this.actionCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.sequenceInformation = new SequenceInformation(data.elements[1]);
|
|
}
|
|
}
|
|
}
|
|
exports.SequenceDetails = SequenceDetails;
|
|
class SplitGoodsPlacement {
|
|
constructor(data) {
|
|
this.tag = "SGP";
|
|
this.equipmentIdentification = new EquipmentIdentification(data.elements[0]);
|
|
if (data.elements.length > 1) {
|
|
this.packageQuantity = parseInt(data.elements[1][0]);
|
|
}
|
|
}
|
|
}
|
|
exports.SplitGoodsPlacement = SplitGoodsPlacement;
|
|
class StatusCategory {
|
|
constructor(data) {
|
|
this.statusCategoryCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class StatusData {
|
|
constructor(data) {
|
|
this.statusDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.statusDescription = data[3];
|
|
}
|
|
}
|
|
class StatusReason {
|
|
constructor(data) {
|
|
this.statusReasonDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.statusReasonDescription = data[3];
|
|
}
|
|
}
|
|
class Status {
|
|
constructor(data) {
|
|
this.tag = "STS";
|
|
if (data.elements.length > 0) {
|
|
this.statusCategory = new StatusCategory(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.status = new StatusData(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.statusReason1 = new StatusReason(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.statusReason2 = new StatusReason(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.statusReason3 = new StatusReason(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.statusReason4 = new StatusReason(data.elements[5]);
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.statusReason5 = new StatusReason(data.elements[6]);
|
|
}
|
|
}
|
|
}
|
|
exports.Status = Status;
|
|
class DutyTaxOrFeeType {
|
|
constructor(data) {
|
|
this.dutyTaxOrFeeTypeNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.dutyTaxOrFreeTypeName = data[3];
|
|
}
|
|
}
|
|
class DutyTaxOrFeeAccountDetail {
|
|
constructor(data) {
|
|
this.dutyTaxOrFeeTypeNameCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class DutyTaxOrFeeDetail {
|
|
constructor(data) {
|
|
this.dutyTaxOrFeeRateDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.dutyTaxOrFeeRateDescription = data[3];
|
|
this.dutyTaxOrFeeRateBasisCode = data[4];
|
|
this.codeListIdentificationCode2 = data[5];
|
|
this.codeListResponsibleAgencyCode2 = data[6];
|
|
}
|
|
}
|
|
class TaxDetails {
|
|
constructor(data) {
|
|
this.tag = "TAX";
|
|
this.dutyTaxOrFeeFunctionCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.dutyTaxOrFeeType = new DutyTaxOrFeeType(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.dutyTaxOrFeeAcountDetail = new DutyTaxOrFeeAccountDetail(data.elements[2]);
|
|
}
|
|
this.dutyTaxOrFreeAssessmentBasisValue = data.elements[3][0];
|
|
if (data.elements.length > 4) {
|
|
this.dutyTaxOrFeeDetail = new DutyTaxOrFeeDetail(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.dutyTaxOrFeeCategoryCode = data.elements[5][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.partyTaxIdentifier = data.elements[6][0];
|
|
}
|
|
if (data.elements.length > 7) {
|
|
this.calculationSequenceCode = data.elements[7][0];
|
|
}
|
|
}
|
|
}
|
|
exports.TaxDetails = TaxDetails;
|
|
class ModeOfTransport {
|
|
constructor(data) {
|
|
this.transportModeNameCode = data[0];
|
|
this.transportModeName = data[1];
|
|
}
|
|
}
|
|
class TransportMeans {
|
|
constructor(data) {
|
|
this.transportMeansDescriptionCode = data[0];
|
|
this.transportMeansDescription = data[1];
|
|
}
|
|
}
|
|
class TransportMeansD02b {
|
|
constructor(data) {
|
|
this.transportMeansDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.transportMeansDescription = data[3];
|
|
}
|
|
}
|
|
class Carrier {
|
|
constructor(data) {
|
|
this.carrierIdentifier = data[0];
|
|
this.codeListIdentificationcode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.carrierName = data[3];
|
|
}
|
|
}
|
|
class ExcessTransportationInformation {
|
|
constructor(data) {
|
|
this.excessTransportationReasonCode = data[0];
|
|
this.excessTransportationResponsibilityCode = data[1];
|
|
this.customerShipmentAuthorisationIdentifier = data[2];
|
|
}
|
|
}
|
|
class TransportIdentification {
|
|
constructor(data) {
|
|
this.transportMeansIdentificationNameIdentifier = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.transportMeansIdentificationName = data[3];
|
|
this.transportMeansNationalityCode = data[4];
|
|
}
|
|
}
|
|
class PowerType {
|
|
constructor(data) {
|
|
this.powerTypeCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.powerTypeDescription = data[3];
|
|
}
|
|
}
|
|
class DetailsOfTransport {
|
|
constructor(data) {
|
|
this.tag = "TDT";
|
|
this.transportStageCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.meansOfTransportJourneyIdentifier = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.modeOfTransport = new ModeOfTransport(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.transportMeans = new TransportMeans(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.carrier = new Carrier(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.transitDirectionIndicatorCode = data.elements[5][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.excessTransportationInformation = new ExcessTransportationInformation(data.elements[6]);
|
|
}
|
|
if (data.elements.length > 7) {
|
|
this.transportIdentification = new TransportIdentification(data.elements[7]);
|
|
}
|
|
if (data.elements.length > 8) {
|
|
this.transportMeansOwnershipIndicatorCode = data.elements[8][0];
|
|
}
|
|
}
|
|
}
|
|
exports.DetailsOfTransport = DetailsOfTransport;
|
|
class TransportInformationD02b {
|
|
constructor(data) {
|
|
this.tag = "TDT";
|
|
this.transportStageCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.meansOfTransportJourneyIdentifier = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.modeOfTransport = new ModeOfTransport(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.transportMeans = new TransportMeansD02b(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.carrier = new Carrier(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.transitDirectionIndicatorCode = data.elements[5][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.excessTransportationInformation = new ExcessTransportationInformation(data.elements[6]);
|
|
}
|
|
if (data.elements.length > 7) {
|
|
this.transportIdentification = new TransportIdentification(data.elements[7]);
|
|
}
|
|
if (data.elements.length > 8) {
|
|
this.transportMeansOwnershipIndicatorCode = data.elements[8][0];
|
|
}
|
|
}
|
|
}
|
|
exports.TransportInformationD02b = TransportInformationD02b;
|
|
class TransportInformationD11a {
|
|
constructor(data) {
|
|
this.tag = "TDT";
|
|
this.transportStageCodeQualifier = data.elements[0][0];
|
|
if (data.elements.length > 1) {
|
|
this.meansOfTransportJourneyIdentifier = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.modeOfTransport = new ModeOfTransport(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.transportMeans = new TransportMeansD02b(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.carrier = new Carrier(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.transitDirectionIndicatorCode = data.elements[5][0];
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.excessTransportationInformation = new ExcessTransportationInformation(data.elements[6]);
|
|
}
|
|
if (data.elements.length > 7) {
|
|
this.transportIdentification = new TransportIdentification(data.elements[7]);
|
|
}
|
|
if (data.elements.length > 8) {
|
|
this.transportMeansOwnershipIndicatorCode = data.elements[8][0];
|
|
}
|
|
if (data.elements.length > 9) {
|
|
this.powerTypeDescription = new PowerType(data.elements[9]);
|
|
}
|
|
}
|
|
}
|
|
exports.TransportInformationD11a = TransportInformationD11a;
|
|
class MovementType {
|
|
constructor(data) {
|
|
this.movementTypeDescriptionCode = data[0];
|
|
this.movementTypeDescription = data[1];
|
|
}
|
|
}
|
|
class TransportMovementDetails {
|
|
constructor(data) {
|
|
this.tag = "TMD";
|
|
if (data.elements.length > 0) {
|
|
this.movementType = new MovementType(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.equipmentPlanDescription = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.haulageArrangementsCode = data.elements[2][0];
|
|
}
|
|
}
|
|
}
|
|
exports.TransportMovementDetails = TransportMovementDetails;
|
|
class TermsOfDeliveryOrTransportData {
|
|
constructor(data) {
|
|
this.deliveryOrTransportTermsDescriptionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.deliveryOrTransportTermsDescription = data[3];
|
|
this.deliveryOrTransportTermsDescription2 = data[4];
|
|
}
|
|
}
|
|
class TermsOfDeliveryOrTransport {
|
|
constructor(data) {
|
|
this.tag = "TOD";
|
|
if (data.elements.length > 0) {
|
|
this.deliveryOrTransportTermsFunctionCode = data.elements[0][0];
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.transportChargesPaymentMethodCode = data.elements[1][0];
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.termsOfDeliveryOrTransport = new TermsOfDeliveryOrTransportData(data.elements[2]);
|
|
}
|
|
}
|
|
}
|
|
exports.TermsOfDeliveryOrTransport = TermsOfDeliveryOrTransport;
|
|
class ContractAndCarriageCondition {
|
|
constructor(data) {
|
|
this.contractAndCarriageConditionCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class Service {
|
|
constructor(data) {
|
|
this.serviceRequirementCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
this.serviceRequirementCode2 = data[3];
|
|
this.codeListIdentificationCode2 = data[4];
|
|
this.codeListResponsibleAgencyCode2 = data[5];
|
|
}
|
|
}
|
|
class TransportPriority {
|
|
constructor(data) {
|
|
this.transportServicePriorityCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class NatureOfCargo {
|
|
constructor(data) {
|
|
this.cargoTypeClassificationCode = data[0];
|
|
this.codeListIdentificationCode = data[1];
|
|
this.codeListResponsibleAgencyCode = data[2];
|
|
}
|
|
}
|
|
class TransportServiceRequirements {
|
|
constructor(data) {
|
|
this.tag = "TSR";
|
|
if (data.elements.length > 0) {
|
|
this.contractAndCarriageCondition = new ContractAndCarriageCondition(data.elements[0]);
|
|
}
|
|
if (data.elements.length > 1) {
|
|
this.service = new Service(data.elements[1]);
|
|
}
|
|
if (data.elements.length > 2) {
|
|
this.transportPriority = new TransportPriority(data.elements[2]);
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.natureOfCargo = new NatureOfCargo(data.elements[3]);
|
|
}
|
|
}
|
|
}
|
|
exports.TransportServiceRequirements = TransportServiceRequirements;
|
|
class MessageIdentifier {
|
|
constructor(data) {
|
|
this.messageType = data[0];
|
|
this.messageVersionNumber = data[1];
|
|
this.messageReleaseNumber = data[2];
|
|
this.controllingAgencyCoded = data[3];
|
|
this.associationAssignedCode = data[4];
|
|
this.codeListDirectoryVersionNumber = data[5];
|
|
this.messageTypeSubFunctionidentification = data[6];
|
|
}
|
|
}
|
|
class StatusOfTransfer {
|
|
constructor(data) {
|
|
this.sequenceOfTransfers = parseInt(data[0]);
|
|
this.firstAndLastTransfer = data[1];
|
|
}
|
|
}
|
|
class MessageSubsetIdentification {
|
|
constructor(data) {
|
|
this.messageSubsetIdentification = data[0];
|
|
this.messageSubsetVersionNumber = data[1];
|
|
this.messageSubsetReleaseNumber = data[2];
|
|
this.controllingAgencyCoded = data[3];
|
|
}
|
|
}
|
|
class MessageImplementationGuidelineIdentification {
|
|
constructor(data) {
|
|
this.messageImplementationGuidelineIdentification = data[0];
|
|
this.messageImplementationGuidelineVersionNumber = data[1];
|
|
this.messageImplementationGuidelineReleaseNumber = data[2];
|
|
this.controllingAgencyCoded = data[3];
|
|
}
|
|
}
|
|
class ScenarioIdentification {
|
|
constructor(data) {
|
|
this.scenarioIdentification = data[0];
|
|
this.scenarioVersionNumber = data[1];
|
|
this.scenarioReleaseNumber = data[2];
|
|
this.controllingAgencyCoded = data[3];
|
|
}
|
|
}
|
|
class MessageHeader {
|
|
constructor(data) {
|
|
this.tag = "UNH";
|
|
this.messageReferenceNumber = data.elements[0][0];
|
|
this.messageIdentifier = new MessageIdentifier(data.elements[1]);
|
|
if (data.elements.length > 2) {
|
|
this.commonAccessReference = data.elements[2][0];
|
|
}
|
|
if (data.elements.length > 3) {
|
|
this.statusOfTransfer = new StatusOfTransfer(data.elements[3]);
|
|
}
|
|
if (data.elements.length > 4) {
|
|
this.messageSubsetIdentification = new MessageSubsetIdentification(data.elements[4]);
|
|
}
|
|
if (data.elements.length > 5) {
|
|
this.messageImplementationGuidelineIdentification = new MessageImplementationGuidelineIdentification(data.elements[5]);
|
|
}
|
|
if (data.elements.length > 6) {
|
|
this.scenarioIdentification = new ScenarioIdentification(data.elements[6]);
|
|
}
|
|
}
|
|
}
|
|
exports.MessageHeader = MessageHeader;
|
|
class SectionControl {
|
|
constructor(data) {
|
|
this.tag = "UNS";
|
|
this.sectionIdentification = data.elements[0][0];
|
|
}
|
|
}
|
|
exports.SectionControl = SectionControl;
|
|
class MessageTrailer {
|
|
constructor(data) {
|
|
this.tag = "UNT";
|
|
this.numberOfSegmentsInAMessage = parseInt(data.elements[0][0]);
|
|
this.messageReferenceNumber = data.elements[1][0];
|
|
}
|
|
}
|
|
exports.MessageTrailer = MessageTrailer;
|
|
//# sourceMappingURL=edifact.js.map
|