-
Notifications
You must be signed in to change notification settings - Fork 52
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
[FEATURE] Ajouter une route de duplication des profils cibles (PIX-11828). #9273
[FEATURE] Ajouter une route de duplication des profils cibles (PIX-11828). #9273
Conversation
Une fois les applications déployées, elles seront accessibles via les liens suivants :
Les variables d'environnement seront accessibles via les liens suivants : |
1c16aa1
to
3ea4e47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L'ordre des fichiers dans les commits est un peu compliqué :/
Je pense qu'il vaut mieux tout squash a la limite, c'est pas si gros.
api/tests/integration/domain/usecases/copy-target-profile_test.js
Outdated
Show resolved
Hide resolved
api/tests/integration/domain/usecases/copy-target-profile_test.js
Outdated
Show resolved
Hide resolved
api/tests/integration/domain/usecases/copy-target-profile_test.js
Outdated
Show resolved
Hide resolved
6844b8f
to
ccb93be
Compare
api/lib/application/target-profiles/target-profile-controller.js
Outdated
Show resolved
Hide resolved
api/lib/infrastructure/repositories/target-profile-repository.js
Outdated
Show resolved
Hide resolved
Dans un test unitaire du usecase copyTargetProfile : Le usecase doit appeler le repo avec les bonnes infos, stub le get du targetProfile qui renverra au choix un symbol ou une instance du domainBuilder, puis stub l'appeler de la création d'un nouveau target profile |
Rajouter un test unitaire ou integ si on tente d'appeler la route avec un rôle non autorisé |
Rajouter un test unitaire sur le controller qui vérifie qu'on appelle le usecase avec les paramètres attendus. A voir si nécessaire par rapport à ce qui est testé dans le test d'acceptance |
ccb93be
to
a480e35
Compare
145443d
to
6877f83
Compare
Une fois les applications déployées, elles seront accessibles via les liens suivants :
Les variables d'environnement seront accessibles via les liens suivants : |
e7098f3
to
dfce982
Compare
const copiedTargetProfile = TargetProfileForCreation.copyTargetProfile({ ...targetProfileToCopy, tubes }); | ||
const copiedTargetProfile = TargetProfileForCreation.copyTargetProfile({ | ||
...targetProfileToCopy, | ||
tubes: targetProfileTubes.map((tube) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion :
Si le repo retourne un model "mappé" comme vous le souhaitez. Ce mapping n'est plus nécessaire côté usecase.
Votre test unitaire dans le dernier commit pourrait s'affranchir de devoir créer un POJO { tubeId, level } pour que le test fonctionne.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je n'ai pas bien compris ce que tu suggérais comme modification ici
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est plus au repository de te remonter un objet du domain comme tu souhaites l'utiliser. Plutôt que de faire le mapping dans ton usecase a partir d'un Pojo "simple".
En créant un objet du domain TargetProfileTube par exemple. Ton repository remonte une liste de trajet profil tube. Et tu as juste a le passer au copyTragetProgile ensuite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tech ok ( les retours ne sont que des suggestions )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Func validé en curl sur la duplication du profil cible 6001
curl -H "Accept: application/json" -H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo5MDAwMCwic291cmNlIjoicGl4IiwiaWF0IjoxNzE4OTc4NDc5LCJleHAiOjE3MTg5Nzk2Nzl9.TYEhAwDURfJGyhdyq4f0eH-mVt39kxbfdPF85Wil-ek" \
-X POST https://app-pr9273.review.pix.fr//api/admin/target-profiles/6001/copy
dfce982
to
d4fce08
Compare
Co-authored-by: Theotime Berthod <theotime.berthod@epitech.digital >
d4fce08
to
b73c7d9
Compare
🦄 Problème
Dans le cadre de l'epix de duplication d'un profil cible, on souhaite créer la route de copie d'un profil cible.
🤖 Proposition
Créer une route qui dupliquera un profil cible et renommera le nouveau profil cible Copie_de_ancienNom.
Remarque
Code temporairement dans le dossier Lib, on compte migrer avant de livrer l'Epix.
💯 Pour tester
Cette PR étant la partie Backend de la feature, le test fonctionnel viendra avec la PR frontend.