Skip to content

Refonte - classe Cotisations#2084

Open
vgreb wants to merge 1 commit into
afup:masterfrom
vgreb:refacto/class-cotisation
Open

Refonte - classe Cotisations#2084
vgreb wants to merge 1 commit into
afup:masterfrom
vgreb:refacto/class-cotisation

Conversation

@vgreb
Copy link
Copy Markdown
Collaborator

@vgreb vgreb commented Jan 5, 2026

  • Utilisation des repository Ting pour la accès bdd
  • Utilisation du model MembershipFee à la place de tableau.

@vgreb vgreb self-assigned this Jan 5, 2026
@vgreb vgreb force-pushed the refacto/class-cotisation branch 3 times, most recently from c02c559 to 93b9710 Compare January 9, 2026 12:39
@vgreb vgreb force-pushed the refacto/class-cotisation branch from 93b9710 to dabb142 Compare January 17, 2026 19:33
@vgreb vgreb force-pushed the refacto/class-cotisation branch from dabb142 to 44a1bfb Compare February 2, 2026 22:46
@vgreb vgreb force-pushed the refacto/class-cotisation branch 3 times, most recently from 3fea1d2 to afb6181 Compare April 20, 2026 00:29
@vgreb vgreb marked this pull request as ready for review April 23, 2026 20:26
@vgreb vgreb force-pushed the refacto/class-cotisation branch 2 times, most recently from 4b3649f to 3abce8d Compare May 10, 2026 13:59
@vgreb
Copy link
Copy Markdown
Collaborator Author

vgreb commented May 10, 2026

resolves #2227

@vgreb vgreb force-pushed the refacto/class-cotisation branch 2 times, most recently from d1eb0a8 to 1993051 Compare May 10, 2026 21:08
Copy link
Copy Markdown
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.

Beau travail, le découpage en service est bien plus cohérent, bravo !

Pas facile à relire 🥵

Comment thread sources/AppBundle/MembershipFee/Model/MembershipFee.php Outdated
Comment thread sources/AppBundle/MembershipFee/Model/Repository/MembershipFeeRepository.php Outdated
Comment thread sources/AppBundle/MembershipFee/MembershipFeeService.php Outdated
Comment thread sources/AppBundle/MembershipFee/MembershipFeeService.php Outdated
@vgreb vgreb force-pushed the refacto/class-cotisation branch from 1993051 to f33390f Compare May 11, 2026 20:20
@vgreb vgreb force-pushed the refacto/class-cotisation branch 2 times, most recently from af2abb5 to 73759cb Compare May 18, 2026 18:53
@vgreb vgreb force-pushed the refacto/class-cotisation branch from 73759cb to 5975511 Compare May 26, 2026 17:57
Comment on lines +66 to +67
$sql .= ' type_reglement= :paymentType,';
$sql .= ' informations_reglement=:paymentInfos';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
$sql .= ' type_reglement= :paymentType,';
$sql .= ' informations_reglement=:paymentInfos';
$sql .= ' type_reglement = :paymentType,';
$sql .= ' informations_reglement = :paymentInfos';

Comment on lines +81 to +82
$sql .= ' type_personne=:userType ';
$sql .= ' AND id_personne=:userId ';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Je nitpick

Suggested change
$sql .= ' type_personne=:userType ';
$sql .= ' AND id_personne=:userId ';
$sql .= ' type_personne = :userType ';
$sql .= ' AND id_personne = :userId ';

Comment on lines +103 to +104
$sql .= ' type_personne=:userType ';
$sql .= ' AND id_personne=:userId ';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
$sql .= ' type_personne=:userType ';
$sql .= ' AND id_personne=:userId ';
$sql .= ' type_personne = :userType ';
$sql .= ' AND id_personne = :userId ';

use AppBundle\Compta\BankAccount\BankAccountFactory;
use AppBundle\MembershipFee\Model\Repository\MembershipFeeRepository;

final class MembershipFeeInvoicePdfGenerator
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion pour éviter la répétition dans le constructeur.

Suggested change
final class MembershipFeeInvoicePdfGenerator
final readonly class MembershipFeeInvoicePdfGenerator

use AppBundle\MembershipFee\Model\Repository\MembershipFeeRepository;
use Webmozart\Assert\Assert;

final class MembershipFeeMailer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pareil ici, y'a peut-être une règle rector pour ça si ça se trouve ?

Suggested change
final class MembershipFeeMailer
final readonly class MembershipFeeMailer

->setInvoiceDate(new \DateTimeImmutable())
;
$this->membershipFeeRepository->save($membershipFee);
return true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

C'est une reprise de l'existant je suppose ? Ça semble pas très utile vu que ça ne retourne jamais false.

Si quelque chose casse y'aura une exception de toute façon.

Comment on lines +21 to +28
* @param $idPersonne Identifiant de la personne
* @param $montant Montant de la cotisation (en euros)
* @param $typeReglement Type de règlement (espèces, chèque, virement)
* @param $informationsReglement Informations concernant le règlement (numéro de chèque, de virement etc.)
* @param $dateDebut Date de début de la cotisation
* @param $dateFin Date de fin de la cotisation
* @param $commentaires Commentaires concernant la cotisation
* @param $referenceClient Référence client à mentionner sur la facture
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On n'y est pas encore mais PHPStan va pas aimer ces annotations 😄

Le fait qu'il y ai juste le nom sans le type va poser problème.

Une suggestion : mettre un paramètre par ligne dans la méthode, avec les commentaires dedans.

Un truc de ce genre :

function foo(
	// lorem
	Bar $bar,
	// ipsum
	int $fiz,
)

Et comme ça on évite le doublon des noms de paramètres.

return ['type' => (int) $memberType, 'id' => (int) $memberId];
}

public function validerReglementEnLigne(string $cmd, float $total, string $autorisation, string $transaction): mixed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Le retour n'est pas du tout utilisé donc on peut s'en passer.

Suggested change
public function validerReglementEnLigne(string $cmd, float $total, string $autorisation, string $transaction): mixed
public function validerReglementEnLigne(string $cmd, float $total, string $autorisation, string $transaction): void

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