|
4 | 4 | An EbdTable is the EDI@Energy raw representation of an "Entscheidungsbaum". |
5 | 5 | """ |
6 | 6 |
|
| 7 | +from datetime import date |
7 | 8 | from typing import List, Optional |
8 | 9 |
|
9 | 10 | import attrs |
10 | 11 |
|
11 | 12 |
|
12 | | -# pylint:disable=too-few-public-methods |
| 13 | +@attrs.define(auto_attribs=True, kw_only=True) |
| 14 | +class EbdDocumentReleaseInformation: |
| 15 | + """ |
| 16 | + Contains information from the title (first) page of the EDI@Energy document which contains all EBDs. |
| 17 | + """ |
| 18 | + |
| 19 | + version: str = attrs.field(validator=attrs.validators.instance_of(str)) |
| 20 | + """ |
| 21 | + the version of the .docx document/file on which this EBD table is based. |
| 22 | + E.g. '4.0b', because (proper) semantic versioning is for loosers ;) |
| 23 | + """ |
| 24 | + release_date: Optional[date] = attrs.field( |
| 25 | + default=None, validator=attrs.validators.optional(attrs.validators.instance_of(date)) |
| 26 | + ) |
| 27 | + """ |
| 28 | + date on which the .docx document/file was released. |
| 29 | + This corresponds to the 'Stand' field in the EDI@Energy document title page, e.g. '2025-06-23'. |
| 30 | + It might be updated even if the version and original_release_date stay the same to indicate there was a |
| 31 | + 'Fehlerkorrektur' in the document. |
| 32 | + """ |
| 33 | + # https://imgflip.com/i/a2saev |
| 34 | + |
| 35 | + original_release_date: Optional[date] = attrs.field( |
| 36 | + default=None, validator=attrs.validators.optional(attrs.validators.instance_of(date)) |
| 37 | + ) |
| 38 | + """ |
| 39 | + date on which the EBD was originally released; It's called 'Ursprüngliches Publikationsdatum' on the EBD document |
| 40 | + title page. E.g. '2024-10-01'. |
| 41 | + """ |
| 42 | + # I think that one could validate that if a `release_date` is set, then the `original_release_date` must be set and |
| 43 | + # before it. But we don't add this validation yet, because we all know the data integrity is... to be improved. |
| 44 | + |
| 45 | + |
| 46 | +# pylint:disable=too-few-public-methods, too-many-instance-attributes |
13 | 47 | @attrs.define(auto_attribs=True, kw_only=True) |
14 | 48 | class EbdTableMetaData: |
15 | 49 | """ |
@@ -47,6 +81,13 @@ class EbdTableMetaData: |
47 | 81 | da keine Antwort gegeben wird und ausschließlich die Liste versandt wird.' |
48 | 82 | """ |
49 | 83 |
|
| 84 | + release_information: Optional[EbdDocumentReleaseInformation] = attrs.field( |
| 85 | + default=None, validator=attrs.validators.optional(attrs.validators.instance_of(EbdDocumentReleaseInformation)) |
| 86 | + ) |
| 87 | + """ |
| 88 | + metadata of the entire EBD document (not the single EBD table) |
| 89 | + """ |
| 90 | + |
50 | 91 |
|
51 | 92 | @attrs.define(auto_attribs=True, kw_only=True) |
52 | 93 | class EbdCheckResult: |
|
0 commit comments