Skip to content

Commit 832298d

Browse files
author
Guillaume
committed
feat(api): add participation store level per tube usecase
1 parent 163766a commit 832298d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

api/src/prescription/campaign-participation/application/jobs/participation-store-level-per-tube-job-controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export class ParticipationSharedJobController extends JobController {
1010
async handle({ data }) {
1111
const { campaignParticipationId } = data;
1212

13-
// TODO: Add a usecase
13+
await usecases.storeCampaignParticipationLevelPerTube({ campaignParticipationId });
1414
}
1515
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const startCampaignParticipation = async ({ campaignParticipationId, knowledgeElementSnapshotRepository }) => {
2+
// get ke snapshot for user participation
3+
const keSnapshot =
4+
knowledgeElementSnapshotRepository.findCampaignParticipationKnowledgeElementSnapshots(campaignParticipationId);
5+
6+
// get tubes and skills for the campaign
7+
// sort user ke by tube
8+
// find the highest skill level for each tube
9+
// store each tube with the highest level in a row in the table
10+
return 42;
11+
};

0 commit comments

Comments
 (0)