add testt files
This commit is contained in:
18
ts/classes.decoder.ts
Normal file
18
ts/classes.decoder.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
/**
|
||||
* A class to convert a given ZUGFeRD XML string
|
||||
* into a structured ILetter with invoice data.
|
||||
*/
|
||||
export class ZUGFeRDXmlDecoder {
|
||||
private xmlString: string;
|
||||
|
||||
constructor(xmlString: string) {
|
||||
this.xmlString = xmlString;
|
||||
}
|
||||
|
||||
public async getLetterData(): Promise<plugins.tsclass.business.ILetter> {
|
||||
const smartxmlInstance = new plugins.smartxml.SmartXml();
|
||||
return smartxmlInstance.parseXmlToObject(this.xmlString);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user