add testt files

This commit is contained in:
2024-12-31 13:38:41 +01:00
parent 2a731fad0d
commit 16e801f3b1
255 changed files with 2394368 additions and 56 deletions

18
ts/classes.decoder.ts Normal file
View 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);
}
}