Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat / Create an expense #18

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Feat / Create an expense #18

wants to merge 3 commits into from

Conversation

engrave-fr
Copy link
Member

No description provided.


use App\Domain\Expense\Expense;

interface ExpenseRepositoryInterface
Copy link

@rchomat rchomat Mar 29, 2024

Choose a reason for hiding this comment

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

Est-ce vraiment utile d'avoir la notion d'interface dans le nom ? La définition en tant qu'interface suffit à mon avis. Cela permettrait dans les constructeurs de services d'avoir la notion de ExpenseRepository qui est suffisant.
Dans le DoctrineExpenseRepositoryle implements est à mon avis assez explicite.
Qu'en penses-tu ?

class Expense
{
public function __construct(
readonly private Uuid $id,
Copy link

Choose a reason for hiding this comment

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

est-ce nécessaire de mettre l'Uuid en paramètre ? On ne pourrait pas le set directement dans le corps du constructeur ? À moins qu'il y ait une utilité que j'oublie ^^

@@ -0,0 +1,16 @@
App\Domain\Expense\Expense:
type: entity
repositoryClass: App\Infrastructure\Expense\Repository\ExpenseRepository
Copy link

Choose a reason for hiding this comment

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

Suggested change
repositoryClass: App\Infrastructure\Expense\Repository\ExpenseRepository
repositoryClass: App\Infrastructure\Expense\Repository\DoctrineExpenseRepository

@@ -15,7 +15,9 @@
"symfony/dotenv": "7.0.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "7.0.*",
"symfony/messenger": "7.0.*",
Copy link

Choose a reason for hiding this comment

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

peut-être faire une PR à part avec toutes ces configs et ajouts de packages et la merger pour que les autres puissent partir de la branche main ?

@@ -0,0 +1,8 @@
<?php

namespace App\Infrastructure\Shared\Bus\Command;
Copy link

@rchomat rchomat Mar 29, 2024

Choose a reason for hiding this comment

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

c'est vraiment dans Infrastructure ? A mon avis, les commandes/query (et leur handler) font partie de l'application et ne devraient pas avoir de dépendances externes

Si je ne dis pas de bêtises, ta classe CreateExpenseCommand devrait implémenter cette interface. Si c'est bien le cas, dans l'état actuel, Application a une dépendance à Infrastructure :)

Il y a d'ailleurs ce vendor qui est sympa en hook git pour vérifier qu'on respecte bien les règles de dépendances : https://github.com/qossmic/deptrac

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.

2 participants