• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gflohr / e-invoice-eu / 14067914634

25 Mar 2025 06:59PM UTC coverage: 68.943%. First build
14067914634

Pull #110

github

web-flow
Merge 128bb09e8 into fbaf9faed
Pull Request #110: Move logic into core library

233 of 371 branches covered (62.8%)

Branch coverage included in aggregate %.

427 of 556 new or added lines in 22 files covered. (76.8%)

726 of 1020 relevant lines covered (71.18%)

72.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/apps/server/src/format/format.factory.service.ts
1
import {
15✔
2
        FormatFactoryService as FormatFactorCoreService,
3
        EInvoiceFormat,
4
} from '@e-invoice-eu/core';
5
import { Injectable, Logger, NotFoundException } from '@nestjs/common';
15✔
6
import { ApiProperty } from '@nestjs/swagger';
15✔
7

8
import { AppConfigService } from '../app-config/app-config.service';
15✔
9
export class FormatInfo {
15✔
10
        @ApiProperty({
11
                description: 'The name of the format',
12
                example: 'UBL',
13
        })
14
        name: string;
15✔
15

16
        @ApiProperty({
17
                description: 'The customization ID of the format',
18
                example: 'urn:cen.eu:en16931:2017',
19
        })
20
        customizationID: string;
15✔
21

22
        @ApiProperty({
23
                description: 'The profile ID of the format',
24
                example: 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
25
        })
26
        profileID: string;
15✔
27

28
        @ApiProperty({
29
                description: 'The appropriate MIME type of the format',
30
                example: 'application/xml',
31
        })
32
        mimeType: string;
15✔
33

34
        @ApiProperty({
35
                description: "The basic syntax of the format ('UBL' or 'CII')",
36
                example: 'UBL',
37
        })
38
        syntax: 'UBL' | 'CII';
15✔
39
}
40

41
@Injectable()
42
export class FormatFactoryService {
15✔
43
        private readonly coreService: FormatFactorCoreService;
44

45
        constructor(private readonly appConfigService: AppConfigService) {
27✔
46
                this.coreService = new FormatFactorCoreService();
27✔
47
        }
48

49
        listFormatServices(): FormatInfo[] {
50
                return this.coreService.listFormatServices();
3✔
51
        }
52

53
        createFormatService(format: string, logger: Logger): EInvoiceFormat {
54
                try {
12✔
55
                        return this.coreService.createFormatService(format, logger);
12✔
56
                } catch {
57
                        throw new NotFoundException(`Format '${format}' not supported.`);
3✔
58
                }
59
        }
60

61
        normalizeFormat(format: string): string {
NEW
62
                return this.coreService.normalizeFormat(format);
×
63
        }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc