Skip to content
Discussion options

You must be logged in to vote

EDIFlow's Business Object Mapping provides exactly this:

import { BusinessObjectMapper } from '@ediflow/core';

// Parse EDIFACT → EDIMessage
const message = parser.parse(edifactString);

// Map to typed business object
const mapper = new BusinessObjectMapper(messageStructure, 'camelCase');
const order = mapper.mapToBusinessObject(message);

// Now you have IntelliSense and type safety!
console.log(order.documentNumber);         // 'PO-001'
console.log(order.parties.buyer.id);       // GLN
console.log(order.lineItems[0].productId); // EAN code
console.log(order.lineItems[0].quantity);  // number

// Modify and map back
order.lineItems[0].quantity = 150;
const updatedMessage = mapper.mapFr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hello-ediflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant