Skip to content

Commit

Permalink
feat(orga): added new attribute in builder
Browse files Browse the repository at this point in the history
  • Loading branch information
alicegoarnisson committed Dec 18, 2024
1 parent 6dcb3f7 commit b295106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const buildKnowledgeElementSnapshot = function ({
userId,
snappedAt = new Date('2020-01-01'),
snapshot,
campaignParticipationId,
} = {}) {
const dateMinusOneDay = new Date(snappedAt.getTime() - 1000 * 60 * 60 * 24 * 7);
userId = _.isUndefined(userId) ? buildUser().id : userId;
Expand All @@ -24,6 +25,7 @@ const buildKnowledgeElementSnapshot = function ({
userId,
snappedAt,
snapshot,
campaignParticipationId,
};

return databaseBuffer.pushInsertable({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { databaseBuffer } from '../database-buffer.js';
import { buildKnowledgeElement } from './build-knowledge-element.js';

function buildSnapshot({ id, userId, snappedAt, knowledgeElementsAttributes }) {
function buildSnapshot({ id, userId, snappedAt, knowledgeElementsAttributes, campaignParticipationId }) {
const knowledgeElements = knowledgeElementsAttributes.map((attributes) => buildKnowledgeElement(attributes));

const values = {
id,
userId,
snappedAt,
snapshot: JSON.stringify(knowledgeElements),
campaignParticipationId,
};

return databaseBuffer.pushInsertable({
Expand Down

0 comments on commit b295106

Please sign in to comment.