Skip to content

Conversation

@vgreb
Copy link
Collaborator

@vgreb vgreb commented Jan 24, 2026

No description provided.

@vgreb vgreb force-pushed the refacto/accounting-journal-list branch 6 times, most recently from 646a7c6 to f794a56 Compare January 30, 2026 17:52
@vgreb vgreb marked this pull request as ready for review January 30, 2026 17:54
@vgreb vgreb requested review from Mopolo and stakovicz February 2, 2026 17:43
Copy link
Contributor

@stakovicz stakovicz left a comment

Choose a reason for hiding this comment

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

Gros chantier ! Bravo !

@vgreb vgreb force-pushed the refacto/accounting-journal-list branch from f794a56 to c7886dd Compare February 2, 2026 20:32
@vgreb vgreb self-assigned this Feb 3, 2026
@vgreb vgreb force-pushed the refacto/accounting-journal-list branch from c7886dd to ecddaef Compare February 3, 2026 08:53

namespace AppBundle\Accounting;

enum OperationType: int
Copy link
Contributor

Choose a reason for hiding this comment

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

Je n'ai pas compris de suite que c'était pour mapper la query, et vu que ça ne sert qu'à ça, je suis pas sûr que ce soit le bon namespace.

Là on pourrait penser que c'est un enum global à toute la tréso je trouve.

Peut-être le déplacer dans le même namespace que le controller ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

J'ai effectivement créer un enum dédié parce qu'il manquait un cas dans \AppBundle\Compta\Importer\OperationType.

Je vais voir si je trouve une solution pour fusionner les deux sinon je déplacerai dans le namespace du controller.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Au final, j'utilise le nouvel enum dans les classes d'import des relevés bancaire.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah. Alors je vais faire mon relou mais là ça pose un nouveau problème pour moi.

Avec cette fusion, on se retrouve avec le code de l'import qui pourrait être dans un état invalide (type = all) alors que ce n'est actuellement pas du tout possible grâce à l'enum limité. Et si on doit avoir du code qui ne peut être QUE débit ou crédit, et bien là il faudrait vérifier à chaque fois que la valeur n'est pas all.

Je comprend bien que les notions soient proches, mais elle ne sont pour autant pas les mêmes. Et j'insiste surtout pour avoir déjà fait ce genre de fusion sur des projets boulot et je l'ai regretté après.

En vrai, vu comment l'enum est utilisé dans le controller, tu pourrais même t'en passer et faire un simple assert :

$type = $request->query->getInt('type');
Webmozart\Assert\Assert::inArray($type, [0, 1, 2]);

Vu que de toute façon l'enum est retransformé en int immédiatement après, autant s'éviter la confusion non ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, ça me va va j'étais parti sur un enum parce que travailler avec 0, 1 et 2 c'est pas très explicite :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah oui t'as raison en fait 😄
Bin dans ce cas pourquoi ne pas en profiter pour utiliser "debit", "credit" et null ?

@vgreb vgreb force-pushed the refacto/accounting-journal-list branch 3 times, most recently from 2c01ac2 to 94f79e2 Compare February 5, 2026 19:54
@vgreb vgreb requested a review from Mopolo February 5, 2026 19:58
@vgreb vgreb force-pushed the refacto/accounting-journal-list branch from d5c5d95 to 0644d3e Compare February 9, 2026 23:05
@vgreb vgreb force-pushed the refacto/accounting-journal-list branch from 0644d3e to 0edbb2f Compare February 9, 2026 23:08
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