@e-invoice-eu/server
Version:
REST API for generating EN16931 conforming electronic invoices
87 lines • 3.4 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatFactoryService = exports.FormatInfo = void 0;
const core_1 = require("@e-invoice-eu/core");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const app_config_service_1 = require("../app-config/app-config.service");
class FormatInfo {
name;
customizationID;
profileID;
mimeType;
syntax;
}
exports.FormatInfo = FormatInfo;
__decorate([
(0, swagger_1.ApiProperty)({
description: 'The name of the format',
example: 'UBL',
}),
__metadata("design:type", String)
], FormatInfo.prototype, "name", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'The customization ID of the format',
example: 'urn:cen.eu:en16931:2017',
}),
__metadata("design:type", String)
], FormatInfo.prototype, "customizationID", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'The profile ID of the format',
example: 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
}),
__metadata("design:type", String)
], FormatInfo.prototype, "profileID", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'The appropriate MIME type of the format',
example: 'application/xml',
}),
__metadata("design:type", String)
], FormatInfo.prototype, "mimeType", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: "The basic syntax of the format ('UBL' or 'CII')",
example: 'UBL',
}),
__metadata("design:type", String)
], FormatInfo.prototype, "syntax", void 0);
let FormatFactoryService = class FormatFactoryService {
appConfigService;
coreService;
constructor(appConfigService) {
this.appConfigService = appConfigService;
this.coreService = new core_1.FormatFactoryService();
}
listFormatServices() {
return this.coreService.listFormatServices();
}
createFormatService(format, logger) {
try {
return this.coreService.createFormatService(format, logger);
}
catch {
throw new common_1.NotFoundException(`Format '${format}' not supported.`);
}
}
normalizeFormat(format) {
return this.coreService.normalizeFormat(format);
}
};
exports.FormatFactoryService = FormatFactoryService;
exports.FormatFactoryService = FormatFactoryService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [app_config_service_1.AppConfigService])
], FormatFactoryService);
//# sourceMappingURL=format.factory.service.js.map