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

[TECH] Expliciter la définiton des quêtes (PIX-16445) #11347

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

laura-bergoens
Copy link
Member

@laura-bergoens laura-bergoens commented Feb 5, 2025

🥞 Problème

Rendre plus explicite, dans la défintion de la quête, son fonctionnement.
Pour l’attestation, on s’attend à ce qu’un prescrit ait une participation pour chaque profil cible listé dans la collection fournie dans le requirement. Mais ce n’est pas clair dans la configuration de la quête, et ça a impliqué du code supplémentaire et difficile à lire pour décortiquer cette contrainte.

🥓 Proposition

Si on souhaite qu’un prescrit ait une campagne participation pour plusieurs profil cibles différents, en fait ça doit impliquer 1 requirement pour chaque participation. Il faut rendre ceci explicite dans la définition de la quête, et de fait ça exprimera le parcours pédagogique souhaité plus clairement dans la quête (et au passage ça simplifie un peu le code)

// avant
{
  type: campaignParticipations,
  data: {
     targetProfileIds: [1, 2],
  }
  comparison: all,
};

// après
[
  {
     type: campaignParticipations,
     data: {
      targetProfileId: 1,
     },
    comparison: all,
  }, 
  {
     type: campaignParticipations,
     data: {
      targetProfileId: 2,
     },
    comparison: all
  }, 
]

🧃 Remarques

Trucs à faire avant / pendant / après :

  • Attendre que les quêtes soient éditées dans le nouveau format
  • lancer le script de rattrapage d'attestation sur la durée entre le moment où les quêtes sont modifiées VS le déploiement de la MEP qui porte cette PR

😋 Pour tester

Non régression fonctionnelle sur l'obtention d'attestation

@pix-bot-github
Copy link

Une fois les applications déployées, elles seront accessibles via les liens suivants :

Les variables d'environnement seront accessibles via les liens suivants :

@xav-car xav-car force-pushed the pix-16445-refacto-quests branch 2 times, most recently from 5919150 to 7d45a16 Compare February 5, 2025 17:12
@laura-bergoens laura-bergoens force-pushed the pix-16445-refacto-quests branch 2 times, most recently from 850de15 to d4b5566 Compare February 6, 2025 13:31
@laura-bergoens
Copy link
Member Author

Bloqué car on attend de passer la feature pour éditer les quêtes côté pixadmin et synchroniser l'ensemble

@laura-bergoens laura-bergoens force-pushed the pix-16445-refacto-quests branch from d4b5566 to 1588ce6 Compare February 6, 2025 13:45
@xav-car xav-car force-pushed the pix-16445-refacto-quests branch from 261bfb3 to bb247c6 Compare February 7, 2025 13:24
@xav-car xav-car force-pushed the pix-16445-refacto-quests branch 2 times, most recently from 3fe5efd to 3286665 Compare February 7, 2025 13:34
@pix-bot-github
Copy link

Une fois les applications déployées, elles seront accessibles via les liens suivants :

Les variables d'environnement seront accessibles via les liens suivants :

@laura-bergoens
Copy link
Member Author

Bloqué car on attend la prochaine MEP 🎉 et on va livrer sa branche enfant dans la meme MEP

@laura-bergoens laura-bergoens force-pushed the pix-16445-refacto-quests branch 2 times, most recently from a55c802 to 9c22f42 Compare February 10, 2025 14:44
@laura-bergoens laura-bergoens force-pushed the pix-16445-refacto-quests branch 3 times, most recently from 12e1c71 to 9ef0271 Compare February 10, 2025 22:16
});

describe('when criterion attribute is an Array', function () {
describe('when item attribute is flat', function () {
Copy link
Member Author

Choose a reason for hiding this comment

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

is not an array

});

describe('when comparison is ONE_OF', function () {
it('should return true if one of the requirements is met', function () {
Copy link
Member Author

Choose a reason for hiding this comment

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

ce n'est pas un ou exclusif !
SI les deux reuqirements sont met, alors true aussi

Copy link
Member Author

Choose a reason for hiding this comment

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

l'ajouter dans ma doc !

Copy link
Member Author

Choose a reason for hiding this comment

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

it('should return true if all requi are met")

@laura-bergoens laura-bergoens force-pushed the pix-16445-refacto-quests branch from a97f35d to b5a8c55 Compare February 12, 2025 14:25
@laura-bergoens laura-bergoens requested a review from a team as a code owner February 12, 2025 14:25
@frinyvonnick frinyvonnick force-pushed the pix-16445-refacto-quests branch 2 times, most recently from 85e9717 to c804aa5 Compare February 12, 2025 15:25
@laura-bergoens laura-bergoens force-pushed the pix-16445-refacto-quests branch from c62ca8f to 7af2451 Compare February 13, 2025 13:46

const eligibilityRequirements = otherRequirements;
if (campaignParticipationRequirements.length > 0) {
eligibilityRequirements.push({
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Si dans le même COMPOSE on a différents type -> CA BUG (cherchez un peu la)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 Func Review Needed Need PO validation for this functionally 👀 Tech Review Needed team-noa(h) noa - noah 🎾 ⚠️ Blocked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants