Skip to content

Some small fixes to be compatible with a database structure#28

Merged
hf-krechan merged 102 commits intomasterfrom
develop
Jan 22, 2021
Merged

Some small fixes to be compatible with a database structure#28
hf-krechan merged 102 commits intomasterfrom
develop

Conversation

@hf-krechan
Copy link
Copy Markdown
Collaborator

  • add BoTyp.GESCHAEFTSOBJEKT
  • rename gebietstyp to gebiettyp like in the BO4E documentation
  • change type of versionstruktur from integer to string

hf-kklein and others added 30 commits December 2, 2020 20:09
📝 Add Links in README.rst to Open PR/Draft a Release
Before strasse and hausnummer were required attributes and postfach was optional.  Since postfach should be an alternative address to strasse and hausnummer this was changed to either strasse and hausnummer or postfach are required attributes.
Additionally the other required attributes are made sure to be strings and not empty.
Add two test: one for postfach as regular required field, the second for different combinations of strasse, hausnummer and postfach to test the validator in the Adresse class (adresse.py)
Co-authored-by: hf-krechan <68426071+hf-krechan@users.noreply.github.com>
Landescode has to be an Enum
…and_fix_typos

✏️ Add details to test_adresse and fix typos
The minimal address in Germany is only a zip code and city  (for example for institutions like universities or big companies or postfächer without a number but a special zip code) 
A street always needs a hausnummer and vice versa.
Postfächer don't have a street, but a number OR a zipcode.
Added test for only postleitzahl and ort
Added docstrings to serialization tests of strasse and postleitzahl
Updated test for the function strasse_xor_postfach in Class Adresse (adresse.py) for the updates in the requirements of a german address
…to_street

🔨 Add postfach as alternative to strasse
Javascript uses CamelCase and python uses snake_case.
Therefore you have to convert the keys during the de- and serialisation
I will miss you 😥
For marshmallow we have to create a Schema for each class we would like to de-/serialise.
hf-krechan and others added 25 commits January 15, 2021 15:13
Co-authored-by: hf-aschloegl <73470827+hf-aschloegl@users.noreply.github.com>
Co-authored-by: hf-kklein <konstantin.klein@hochfrequenz.de>
I will remove the E501 (ignore line length) in the next PR.
I will update the format settings for black and flake9 in the next PR
Co-authored-by: hf-aschloegl <73470827+hf-aschloegl@users.noreply.github.com>
Remove s in gebietstyp to match the same naming like the BO4E documenation
Empty list makes the implementation into a database easier compared to None type.
The BoTyp can be used as a descriminator in databases.
But the Geschaeftsobjekt itself has no BoTyp in the documentation.
To realize a good table inheritance you have to define a table for each class and **each** class have to identified by a discriminator. Therefore we added the BoTyp.GESCHAEFTSOBJEKT to the BoTyp enumeration.
kontaktweg and geschaeftspartnerrolle changed to List type
Got error in sphinx documentation: 

invalid signature for autoattribute ('bo4e.enum.marktrolle::Marktrolle.KUNDE-SELBST-NN')
Copy link
Copy Markdown
Collaborator Author

@hf-krechan hf-krechan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added two notes to clearify the motivation of some changes

Comment thread src/bo4e/enum/botyp.py
@@ -5,28 +5,32 @@
from enum import Enum

_boTyp = {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have sorted all BoTypes alphabetically

@@ -1,9 +1,9 @@
"""
List of possible Gebietstypen.
List of possible Gebiettypen.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed s in Gebietstypen, cause the documentation calls this enum just Gebiettyp

@hf-krechan hf-krechan marked this pull request as ready for review January 22, 2021 18:23
@hf-krechan hf-krechan merged commit 005ec93 into master Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants