Closed lenaing closed 5 years ago
Cette vérification pourrait être faite dans PlatformUseCases.getValuedProperties
, avant l'appel à excludePropertiesWithOnlyDefaultValue
qui lève cette exception
Réflexion faite, on veut détecter ce cas lors des opérations de création de template / MAJ de template
Il serait très intéressant d'avoir un test BDD pour ce type de cas, car c'est un "trou dans la raquette" du même type que ceux identifiés dans https://github.com/voyages-sncf-technologies/hesperides/issues/705 &https://github.com/voyages-sncf-technologies/hesperides/issues/648 & https://github.com/voyages-sncf-technologies/hesperides/issues/505 & https://github.com/voyages-sncf-technologies/hesperides/issues/89
Petite analyse des modifications à apporter pour corriger ce bug "proprement" (validée avec @thomaslhostis) :
ModuleAggregate.onCreateTemplateCommand/.onUpdateTemplateCommand
ModuleDocument.extractPropertiesAndSave
) dans la couche domaine (en ajoutant un champ Module.properties
)CreateTemplate
/ UpdateTemplate
pour qu'ils contiennent l'entitié Module
au completCR de notre discussion là-dessus à l'instant avec @thomaslhostis & @lenaing
ce refacto implique de faire "grossir" CreateTemplateCommand
& TemplateCreatedEvent
, en leur ajoutant un minima un champ .properties
. Est-ce vraiment souhaitable ? Le bénéfice en termes de clarté de code vaut-il une telle augmentation de la volumétrie de données ?
ce sujet en tire un autre important : comme gérer l'évolution du schéma des commands & events du bus ? Dans le cas de l'ajout d'un champ .properties
à TemplateCreatedEvent
par exemple, cela signifie que le code doit être capable de gérer à la fois les anciens événements sans ce champ et les nouveaux l'ayant ? Ou bien faut-il envisager une migration de tous les événements historiques pour leur rajouter ce champ ?
tl,pl : refacto trop couteux en temps à réaliser, et "risqué" en terme d'impact -> on n'attaque pas le sujet maintenant
Issue dédiée : https://github.com/voyages-sncf-technologies/hesperides/issues/744
Exemple de template:
Stacktrace: