22 lines
642 B
TypeScript
22 lines
642 B
TypeScript
|
import { CIIBaseEncoder } from '../cii.encoder.js';
|
||
|
import type { TInvoice } from '../../../interfaces/common.js';
|
||
|
import { ZUGFERD_PROFILE_IDS } from './zugferd.types.js';
|
||
|
|
||
|
/**
|
||
|
* Encoder for ZUGFeRD invoice format
|
||
|
*/
|
||
|
export class ZUGFeRDEncoder extends CIIBaseEncoder {
|
||
|
/**
|
||
|
* Creates ZUGFeRD XML from invoice data
|
||
|
* @param invoice Invoice data
|
||
|
* @returns ZUGFeRD XML string
|
||
|
*/
|
||
|
public async createXml(invoice: TInvoice): Promise<string> {
|
||
|
// Set ZUGFeRD-specific profile ID
|
||
|
this.profileId = ZUGFERD_PROFILE_IDS.BASIC;
|
||
|
|
||
|
// Use the base CII encoder to create the XML
|
||
|
return super.createXml(invoice);
|
||
|
}
|
||
|
}
|