Skip to content

Commit e394221

Browse files
paulsouchebjlaaClemoglsagetlethias
authored
Release 2.4.1 (#363)
* ✨ Send the water footprint to Brevo (#167) * 🔖 v1.1.1 * 🐛 fix postgre replication errors (#170) * 🧱 migrate organisations to postgre (NGC-1173) (#165) * 🔥 dead function * 🗃️ verification-codes migration * 🗃️ organisations migration * ✨ organisations creation in database * ✨ verification codes creation in database * ♻️ update also in postgres * 🐛 fix postgre replication errors (#172) * 🔖 v1.1.2 * ♻️ Remove decimal from water footprint (#174) * ✨ Send the water footprint to Brevo * ♻️ Remove decimal in the water footprint * 👔 groups simulations fetch logic (#176) * 🐛 various replication issues (#175) * 🐛 groups replication * 🐛 polls replication * 🐛 organisations replication * ♻️ organisations import really idempotent * 🔖 v1.1.3 * ✨ new authentication system (NGC-287) (#168) * ✨ create verification codes route * ✨ EventBus for side effects * ✨ new Brevo adapter * ✨ send verification code email * ✨ login * ✨ logout * ♻️ remove cookies constants * ♻️ authentication middleware * ♻️ remove generateRandomNumberWithLength * ✨ agir export situation use-case NGC-1294 (#179) * ✅ improve tests to avoid flakyness (#181) * ⬆️ bump prismock to fix a bug * ♻️ decorate prismock delegates to avoid boilerplate * 🐛 increase test timeout * ✅ clean nock after each test * ✅ no need to JSON.stringify nock payload * 🎨 improve tests labels * ✅ ensure database is cleared after each test * ✨ Organisations routes (NGC-1215) (#171) * ✅ nock.cleanAll the right place * 🐛 timeout the right place * ✨ create organisations route * ✨ update organisation route * ✨ fetch organisation(s) routes * ✨ create poll route * ✨ update poll route * ✨ delete poll route * ✨ fetch poll(s) routes * ♻️ organisations with custom questions * 🧱 migrate simulations to postgre (NGC-1242, NGC-1235) (#178) * 🗃️ simulations migration * ✨ simulations creation in database * ♻️ update also in postgres * ✨ simulations create route * ✨ simulations create side effects * ✨ fetch simulation(s) routes * ✨ poll simulations create route * ✨ poll simulations create side effects * 👔 groups routes logic * ✨ group & participant create side effects * ✏️ review comments * 🐛 organisation import * 🐛 postgre sync simulation needed for participant * 🔖 v1.2.0 * 🛂 decomission send email calls (#184) * 🐛 create simulation various fixes (NGC-1235) (#183) * 👔 do not send emails on unfinished simulations * 👔 replicate on new API * 👔 return polls slugs instead of ids * 🎨 look for token in all cookies * 🐛 do not crash server when sending several create simulation * 🎨 better test structure to welcome new cases * ✅ add non regression tests on authenticationmiddleware (#185) * 🔖 v1.2.1 * 🗃️ ngc schema (#193) * 🛂 database grant select access to ngc schema (#194) * 🐛 numberOfCollaborators: Invalid value provided (#192) * ✨ sync brevo contact when needed (NGC-1274) (#190) * ♻️ brevo constants in one place * ✨ update brevo contact on authentication NGC-1274 * ✨ update brevo contact on organisations NGC-1274 * ✨ update brevo contact on groups NGC-1274 * ✨ update brevo contact on simulations NGC-1274 * ✨ handle ListIds.GROUP_JOINED * ✨ handle ListIds.UNFINISHED_SIMULATION * ✨ handle NEWSLETTERS * 🎨 group edge case where a paticipant joins before admin * 🔖 v1.3.0 * ✨ device change (NGC-1310) (#191) * ♻️ auth middleware in unauthenticated mode (NGC-1310) * ✨ device change (NGC-1310) * ♻️ prisma transactions (#195) * ⬆️ update prisma client * ♻️ transactions when needed * 🐛 some simulations have no progression on preprod (#197) * 🐛 some simulations have no user on preprod * 👔 API changes for the frontend (#198) * ✅ test configuration * ⬆️ update model * ♻️ common selects to avoid circular references * 👔 organisation in polls * ✨ polls public data * 👔 simulations details in polls * ✨ public poll simulations * ✨ public poll dashboard * 👔 groups public data * 💥 create simulations endpoints * 🐛 brevo returns 400 instead of 200 * 🦺 allow nullable organisation dtos values to reset field * 🐛 organisation administrator email change (#199) * 🐛 organisation administrator email change * 🔧 change test setup to connect to pg-lite * ✅ increase timeout * :refactor: change afterEach cleanUp to avoid constraint errors * :refactor: updatedAt prisma flag is now correctly handled * :refactor: bye prismock * :refactor: ensure transaction everywhere * 🔖 v1.4.0 * 🐛 don't grant in parallel during deploy * 🔖 v1.4.1 * ✅ fix sync user data (#202) * ⚡ do not sync data twice * 🗃️ add simulation user index * ✅ sync user data * 💄 variables naming * 👔 change send simulation email logic (#203) * ✨ create view for computedResults `bilan` (NGC-1437) (#204) * feat: create view for `bilan` * fix: convert extracted field to text * feat: improve view * feat: add migration file to test config * fix: wrong filename * 🎨 ran prisma format * ✅ flaky test --------- Co-authored-by: Paul Souche <paul@bettercallpaul.fr> * 🔖 v1.5.0 * ✨ newsletter routes refactored (#206) * ✨ get newsletter subscribers * ✨ get user contact * ✨ update user contact * 🧑‍💻 various improvements (#208) * 🧑‍💻 husky * 🗑️ old API * ⬆️ nosgestesclimat model (#207) * ⬆️ nosgestesclimat model * 💚 fix CI job * ✨ export situation on 2 tonnes (NGC-1445) (#209) * ✨ export situation on 2 tonnes (NGC-1445) * 🦺 improve agir validation * ♻️ use prisma client enums instead of redefining them (#211) * ♻️ QuizzAnswerIsAnswerCorrect enum * ♻️ NorthstarRatingType enum * ♻️ PollDefaultAdditionalQuestionType enum * ♻️ SimulationAdditionalQuestionAnswerType enum * ♻️ OrganisationType enum * ♻️ optional verification code user (#213) * 🗃️ optional verification code user * ♻️ wrap verification code in event * 🗃️ remove useless migrations (#214) * 🗃️ remove useless migrations * 🔧 jest generic migrations * 🔖 v1.6.0 * ✨ api authentication (NGC-1503) (#210) * 🗃️ models for integrations API * ♻️ allows multiple post migration scripts * 🗃️ integrations API scopes creation * 🗃️ integrations API whitelist creation * ➕ ts-rest * ✨ openapi * ✨ generate API token route * ✨ recover API token route * ✨ refresh API token route * 🚑 public poll simulations for admin (#217) * 🧪 failing test * 💚 fix failing test * 🩹 public poll dashboard * 🔖 v1.6.1 * ⬆️ nosgestesclimat model (#219) * ✨ email whitelist crud (NGC-1504) (#216) * ✨ init feature * ✨ create email whitelist route * ✨ delete email whitelist route * ✨ fetch email whitelists route * ✨ update email whitelist route * ♻️ put things at the right place * 👔 Change update user & contact logic (NGC-1442) (#221) * 👔 change update user logic WIP * 🎨 test not it * 🎨 remove brevo from API * 💩 make poll simulations public again (NGC-1551) (#222) * ✨ mapping files CRUD (NGC-1505) (#220) * ✨ init feature (NGC-1505) * 🔧 scaleway client * ✨ create mapping file route * ✨ delete mapping file route * ✨ fetch mapping file route * 🔖 v1.7.0 * ✨ add model in simulations (NGC-1166) (#226) * 🗃️ simulation model migration (NGC-1166) * 👔 change simulations logic (NGC-1166) * ✨ map situation (NGC-1531) (#223) * ✨ init feature (NGC-1531) * ✨ map situation (NGC-1531) * 🐛 fix sentry issue (#228) * ⬆️ publicode * 🐛 fix sentry issue * 🔧 pin engine version (#229) * 🔧 setup sentry (NGC-1564) (#227) * ⬆️ nosgestesclimat model (#230) * 🔖 v1.8.0 * Revert "🐛 fix sentry issue (#228)" This reverts commit fdd5688. * Revert ":wrench: setup sentry (NGC-1564) (#227)" This reverts commit 0e38dad. * 🔖 v1.8.1 * 🔥 remove mongodb and socket.io (NGC-1523) (#233) * ✨ organisation type default value (NGC-1515) (#232) * 🗃️ organisation type default value (NGC-1515) * ♻️ migration code changes (NGC-1515) * 👔 public simulations (#235) * 🐛 update settings email is in body (#236) * 🔖 v1.9.0 * ✨ remove params prefix on partner call (NGC-1620) (#239) * 🔥 forgotten files (#238) * 🐛 organisation administrator are not admin for all public polls (#240) * 🧪 public polls admin * 🐛 do not return organisation administrators for logged users * 🔖 v1.9.1 * ♻️ put ugly funfacts code back in place (#242) * ♻️ put ugly funfacts code back in place * 🧪 compare engine and algorithm * 💚 fix tests except averageOfElectricityConsumption * ♻️ remove ugly compute on average funfacts * ♻️ remove global engine (could not change the rules anyway) * ⬆️ nosgestesclimat model * 🔖 v1.9.2 * 💩 public polls are public (NGC-1642) (#244) * 🩹 stop trusting userId for administrators email is the truth (NGC-1654) (#246) * 🧪 public poll with device change * 🩹 stop trusting userId for administrators email is the truth * 🔧 remove mongo image (NGC-1523) (#245) * ✨ change case following query param (NGC-1659) (#247) * 🔖 v1.10.0 * ✨ be able to handle asynchronous events (NGC-1621) (#249) * 🔧 setup redis (NGC-1621) * 🏷️ runtime event types * ✨ emit redis event again * 🩹 do not send email twice when participating to something (NGC-1625) (#250) * 🧪 do not send email twice when participating to a poll * 🩹 do not send email twice when participating to a poll * 🧪 do not send email twice when joining a group * 🩹 do not send email twice when joining a group * 🔊 improve logs (NGC-1731) (#253) * 🔖 v1.11.0 * ✨ funfacts worker (NGC-1724) (#254) * ♻️ simulation repository done well * 💄 clean bootstrap * 🔧 declare worker * 🗃️ fun facts in polls (NGC-1621) * ✨ flush EventBus * ♻️ eventbus should be flushed in tests * ♻️ async SimulationUpsertedEvent * 🧪 compute poll fun facts * ✨ compute poll fun facts * 🔧 scalingo cors configuration (NGC-1656) (#255) * 🔊 ip + JSON format (NGC-1656) (#256) * 🔊 ip + JSON format (NGC-1656) * 💚 flaky tests * ✨ geoip (NGC-1726) (#257) * ✨ geoip to redis (NGC-1726) * ♻️ database scripts (NGC-1726) * 💚 flaky tests (#258) * 💚 flaky tests * ♻️ jest => vitest * ♻️ nock => msw * ➕ coverage * ✨ geolocation endpoint (NGC-1726) (#259) * 🦺 improve geo ip validation * ✨ geolocation endpoint * ✏️ review comments * ⬆️ publicode (#251) * ⬆️ publicode * 💩 but don't use the engine * 🔖 v1.12.1 * 🩹 return less data on poll simulations (NGC-1783) (#262) * 🔖 v1.12.2 * 🗃️ populate polls funFacts (NGC-1784) (#264) * ♻️ stream poll simulations to not explode memory (NGC-1784) * 🗃️ populate polls funFacts (NGC-1784) * 🔖 v1.12.3 * ♻️ transactions (#266) * ♻️ open a transaction is not a repository job * ♻️ mitigate transaction usage * ✨ update user newsletters (NGC-1727) (#267) * ✨ update user newsletters * ✨ newsletters confirmation * ✨ partners endpoint (NGC-1840) (#268) * ✨ partners endpoint (NGC-1840) * ✨ partners features (NGC-1840) * ♻️ newsletter-confirmation (NGC-1727) (#269) * 🔖 v1.13.0 * ♻️ remove transactions on fetch requests * 🔖 v1.13.1 * 🚑 stop returning all poll simulations * 🔖 v1.13.2 * 🚑 no session in worker * 🔖 v1.13.3 * 🚑 fun facts worker loop (#274) * ♻️ simulation upsert informations on event * ⚰️ remove dashboard endpoint * 🚑 poll funfacts worker do not loop over simulations every time * 🔖 v1.14.0 * 🚑 remove user deduplication transaction * 🔖 v1.14.1 * 🚑 various fixes for performances issues (#277) * 🚑 remove administrator query transaction * 🚑 remove duplicated dedupe user logic * 🔖 v1.14.2 * 🚑 worker polls redis cache (#279) * 🧪 be sure cache is used * ♻️ avoid any query in worker with cache * 🔖 v1.14.3 * ⚡ change slow query * 🔖 v1.14.4 * 🛂 rate limiting middleware (NGC-1872) (#283) * Release 1.14.4 (#281) * Merge main Release 1.0.7 * ✨ Tracker les liens dans les emails (NGC-922) (#143) * 🚧 setup lint and format properly (#147) * Modification du schéma Simulation pour sauvegarder les sous-cat + nouveau format pour les (#146) * ✨ setup logger (NGC 1139) (#150) * ➕ logger dependencies * 🔧 setup logger * 💩 evaluate computedResults on fetch (NGC-1140) (#151) * 💩 evaluate computedResults on fetch (NGC-1140) * 💩 evaluate computedResults on fetch groups (NGC-1140) * ♻️ make engine really static * 🐛 empty computedResults in database (#154) * 🔖 v1.0.10 * 🧱 migrate northstar ratings to postgre (NGC-1143) (#153) * ➕ prisma orm dependencies * 🔧 init prisma * 🗃️ northstar ratings migration * 🧪 add a failing test * 🦺 northstar ratings validation * 🧪 add a failing test * ✨ northstar ratings creation * 🧪 add a failing test * ✨ northstar ratings creation in database * 🔧 run migrations during scalingo deploy * 🚨 lint * 🐳 docker-compose services * 📝 README * 🗑️ deprecate old route * 🧱 migrate quizz answers to postgre (NGC-1144) (#156) * 🗃️ quizz answers migration * ✨ quizz answers creation in database * 🗑️ deprecate old route * ✅ northstar improvements * 🧱 migrate users to postgre (NGC-1160) (#157) * 🗃️ users migration * ✨ users creation in database * ♻️ update also in postgres * 🐛 empty computedResults in polls simulations (#159) * 🧱 migrate legacy schemas to postgre (NGC-1163) (#158) * 🔥 remove unused schemas * 🗃️ surveys migration * ✨ surveys creation in database * ♻️ update also in postgres * 🗃️ email-simulations migration * ✨ email simulations creation in database * 🗃️ answers migration * ✨ answers creation in database * 🦺 northstar ratings documents * 🦺 quizz answers documents * 🦺 users documents * ♻️ update also in postgres * 🐛 create simulation with group and no email (#160) * 🔖 v1.1.0 * ✨ migrate organisations simulations computedResults (#162) * ⬆️ model package * ✨ eau metric on organisations simulations migration --------- Co-authored-by: Paul Souche <paul@bettercallpaul.fr> * 🐛 remove groups bad participants (NGC-1188) (#164) * 🧱 migrate groups to postgre (NGC-1167) (#163) * 🗃️ groups migration * ♻️ remove debug try catch * ✨ groups creation in database * 🚨 unused vars shenanigan * ✅ bumping prismock to fix bug * ✨ create groups route * ✨ update group route * ✨ participant joins route * ✨ participant leaves route * ✨ fetch user groups route * ✨ fetch user group route * ✨ delete user group route * 🔧 exclude coverage from workspace * ♻️ update also in postgres * 🐛 don't erase email if empty * ♻️ features api v1 * 🐛 avoid capital letters in emails * 🗃️ groups simulations full computedResults migration (NGC-1113) (#166) * 🗃️ groups migration (NGC-1113) * 🐛 sync mongo & pg group id * ✨ Send the water footprint to Brevo (#167) * 🔖 v1.1.1 * 🐛 fix postgre replication errors (#170) * 🧱 migrate organisations to postgre (NGC-1173) (#165) * 🔥 dead function * 🗃️ verification-codes migration * 🗃️ organisations migration * ✨ organisations creation in database * ✨ verification codes creation in database * ♻️ update also in postgres * 🐛 fix postgre replication errors (#172) * 🔖 v1.1.2 * ♻️ Remove decimal from water footprint (#174) * ✨ Send the water footprint to Brevo * ♻️ Remove decimal in the water footprint * 👔 groups simulations fetch logic (#176) * 🐛 various replication issues (#175) * 🐛 groups replication * 🐛 polls replication * 🐛 organisations replication * ♻️ organisations import really idempotent * 🔖 v1.1.3 * ✨ new authentication system (NGC-287) (#168) * ✨ create verification codes route * ✨ EventBus for side effects * ✨ new Brevo adapter * ✨ send verification code email * ✨ login * ✨ logout * ♻️ remove cookies constants * ♻️ authentication middleware * ♻️ remove generateRandomNumberWithLength * ✨ agir export situation use-case NGC-1294 (#179) * ✅ improve tests to avoid flakyness (#181) * ⬆️ bump prismock to fix a bug * ♻️ decorate prismock delegates to avoid boilerplate * 🐛 increase test timeout * ✅ clean nock after each test * ✅ no need to JSON.stringify nock payload * 🎨 improve tests labels * ✅ ensure database is cleared after each test * ✨ Organisations routes (NGC-1215) (#171) * ✅ nock.cleanAll the right place * 🐛 timeout the right place * ✨ create organisations route * ✨ update organisation route * ✨ fetch organisation(s) routes * ✨ create poll route * ✨ update poll route * ✨ delete poll route * ✨ fetch poll(s) routes * ♻️ organisations with custom questions * 🧱 migrate simulations to postgre (NGC-1242, NGC-1235) (#178) * 🗃️ simulations migration * ✨ simulations creation in database * ♻️ update also in postgres * ✨ simulations create route * ✨ simulations create side effects * ✨ fetch simulation(s) routes * ✨ poll simulations create route * ✨ poll simulations create side effects * 👔 groups routes logic * ✨ group & participant create side effects * ✏️ review comments * 🐛 organisation import * 🐛 postgre sync simulation needed for participant * 🔖 v1.2.0 * 🛂 decomission send email calls (#184) * 🐛 create simulation various fixes (NGC-1235) (#183) * 👔 do not send emails on unfinished simulations * 👔 replicate on new API * 👔 return polls slugs instead of ids * 🎨 look for token in all cookies * 🐛 do not crash server when sending several create simulation * 🎨 better test structure to welcome new cases * ✅ add non regression tests on authenticationmiddleware (#185) * 🔖 v1.2.1 * 🗃️ ngc schema (#193) * 🛂 database grant select access to ngc schema (#194) * 🐛 numberOfCollaborators: Invalid value provided (#192) * ✨ sync brevo contact when needed (NGC-1274) (#190) * ♻️ brevo constants in one place * ✨ update brevo contact on authentication NGC-1274 * ✨ update brevo contact on organisations NGC-1274 * ✨ update brevo contact on groups NGC-1274 * ✨ update brevo contact on simulations NGC-1274 * ✨ handle ListIds.GROUP_JOINED * ✨ handle ListIds.UNFINISHED_SIMULATION * ✨ handle NEWSLETTERS * 🎨 group edge case where a paticipant joins before admin * 🔖 v1.3.0 * ✨ device change (NGC-1310) (#191) * ♻️ auth middleware in unauthenticated mode (NGC-1310) * ✨ device change (NGC-1310) * ♻️ prisma transactions (#195) * ⬆️ update prisma client * ♻️ transactions when needed * 🐛 some simulations have no progression on preprod (#197) * 🐛 some simulations have no user on preprod * 👔 API changes for the frontend (#198) * ✅ test configuration * ⬆️ update model * ♻️ common selects to avoid circular references * 👔 organisation in polls * ✨ polls public data * 👔 simulations details in polls * ✨ public poll simulations * ✨ public poll dashboard * 👔 groups public data * 💥 create simulations endpoints * 🐛 brevo returns 400 instead of 200 * 🦺 allow nullable organisation dtos values to reset field * 🐛 organisation administrator email change (#199) * 🐛 organisation administrator email change * 🔧 change test setup to connect to pg-lite * ✅ increase timeout * :refactor: change afterEach cleanUp to avoid constraint errors * :refactor: updatedAt prisma flag is now correctly handled * :refactor: bye prismock * :refactor: ensure transaction everywhere * 🔖 v1.4.0 * 🐛 don't grant in parallel during deploy * 🔖 v1.4.1 * ✅ fix sync user data (#202) * ⚡ do not sync data twice * 🗃️ add simulation user index * ✅ sync user data * 💄 variables naming * 👔 change send simulation email logic (#203) * ✨ create view for computedResults `bilan` (NGC-1437) (#204) * feat: create view for `bilan` * fix: convert extracted field to text * feat: improve view * feat: add migration file to test config * fix: wrong filename * 🎨 ran prisma format * ✅ flaky test --------- Co-authored-by: Paul Souche <paul@bettercallpaul.fr> * 🔖 v1.5.0 * ✨ newsletter routes refactored (#206) * ✨ get newsletter subscribers * ✨ get user contact * ✨ update user contact * 🧑‍💻 various improvements (#208) * 🧑‍💻 husky * 🗑️ old API * ⬆️ nosgestesclimat model (#207) * ⬆️ nosgestesclimat model * 💚 fix CI job * ✨ export situation on 2 tonnes (NGC-1445) (#209) * ✨ export situation on 2 tonnes (NGC-1445) * 🦺 improve agir validation * ♻️ use prisma client enums instead of redefining them (#211) * ♻️ QuizzAnswerIsAnswerCorrect enum * ♻️ NorthstarRatingType enum * ♻️ PollDefaultAdditionalQuestionType enum * ♻️ SimulationAdditionalQuestionAnswerType enum * ♻️ OrganisationType enum * ♻️ optional verification code user (#213) * 🗃️ optional verification code user * ♻️ wrap verification code in event * 🗃️ remove useless migrations (#214) * 🗃️ remove useless migrations * 🔧 jest generic migrations * 🔖 v1.6.0 * ✨ api authentication (NGC-1503) (#210) * 🗃️ models for integrations API * ♻️ allows multiple post migration scripts * 🗃️ integrations API scopes creation * 🗃️ integrations API whitelist creation * ➕ ts-rest * ✨ openapi * ✨ generate API token route * ✨ recover API token route * ✨ refresh API token route * 🚑 public poll simulations for admin (#217) * 🧪 failing test * 💚 fix failing test * 🩹 public poll dashboard * 🔖 v1.6.1 * ⬆️ nosgestesclimat model (#219) * ✨ email whitelist crud (NGC-1504) (#216) * ✨ init feature * ✨ create email whitelist route * ✨ delete email whitelist route * ✨ fetch email whitelists route * ✨ update email whitelist route * ♻️ put things at the right place * 👔 Change update user & contact logic (NGC-1442) (#221) * 👔 change update user logic WIP * 🎨 test not it * 🎨 remove brevo from API * 💩 make poll simulations public again (NGC-1551) (#222) * ✨ mapping files CRUD (NGC-1505) (#220) * ✨ init feature (NGC-1505) * 🔧 scaleway client * ✨ create mapping file route * ✨ delete mapping file route * ✨ fetch mapping file route * 🔖 v1.7.0 * ✨ add model in simulations (NGC-1166) (#226) * 🗃️ simulation model migration (NGC-1166) * 👔 change simulations logic (NGC-1166) * ✨ map situation (NGC-1531) (#223) * ✨ init feature (NGC-1531) * ✨ map situation (NGC-1531) * 🐛 fix sentry issue (#228) * ⬆️ publicode * 🐛 fix sentry issue * 🔧 pin engine version (#229) * 🔧 setup sentry (NGC-1564) (#227) * ⬆️ nosgestesclimat model (#230) * 🔖 v1.8.0 * Revert "🐛 fix sentry issue (#228)" This reverts commit fdd5688. * Revert ":wrench: setup sentry (NGC-1564) (#227)" This reverts commit 0e38dad. * 🔖 v1.8.1 * 🔥 remove mongodb and socket.io (NGC-1523) (#233) * ✨ organisation type default value (NGC-1515) (#232) * 🗃️ organisation type default value (NGC-1515) * ♻️ migration code changes (NGC-1515) * 👔 public simulations (#235) * 🐛 update settings email is in body (#236) * 🔖 v1.9.0 * ✨ remove params prefix on partner call (NGC-1620) (#239) * 🔥 forgotten files (#238) * 🐛 organisation administrator are not admin for all public polls (#240) * 🧪 public polls admin * 🐛 do not return organisation administrators for logged users * 🔖 v1.9.1 * ♻️ put ugly funfacts code back in place (#242) * ♻️ put ugly funfacts code back in place * 🧪 compare engine and algorithm * 💚 fix tests except averageOfElectricityConsumption * ♻️ remove ugly compute on average funfacts * ♻️ remove global engine (could not change the rules anyway) * ⬆️ nosgestesclimat model * 🔖 v1.9.2 * 💩 public polls are public (NGC-1642) (#244) * 🩹 stop trusting userId for administrators email is the truth (NGC-1654) (#246) * 🧪 public poll with device change * 🩹 stop trusting userId for administrators email is the truth * 🔧 remove mongo image (NGC-1523) (#245) * ✨ change case following query param (NGC-1659) (#247) * 🔖 v1.10.0 * ✨ be able to handle asynchronous events (NGC-1621) (#249) * 🔧 setup redis (NGC-1621) * 🏷️ runtime event types * ✨ emit redis event again * 🩹 do not send email twice when participating to something (NGC-1625) (#250) * 🧪 do not send email twice when participating to a poll * 🩹 do not send email twice when participating to a poll * 🧪 do not send email twice when joining a group * 🩹 do not send email twice when joining a group * 🔊 improve logs (NGC-1731) (#253) * 🔖 v1.11.0 * ✨ funfacts worker (NGC-1724) (#254) * ♻️ simulation repository done well * 💄 clean bootstrap * 🔧 declare worker * 🗃️ fun facts in polls (NGC-1621) * ✨ flush EventBus * ♻️ eventbus should be flushed in tests * ♻️ async SimulationUpsertedEvent * 🧪 compute poll fun facts * ✨ compute poll fun facts * 🔧 scalingo cors configuration (NGC-1656) (#255) * 🔊 ip + JSON format (NGC-1656) (#256) * 🔊 ip + JSON format (NGC-1656) * 💚 flaky tests * ✨ geoip (NGC-1726) (#257) * ✨ geoip to redis (NGC-1726) * ♻️ database scripts (NGC-1726) * 💚 flaky tests (#258) * 💚 flaky tests * ♻️ jest => vitest * ♻️ nock => msw * ➕ coverage * ✨ geolocation endpoint (NGC-1726) (#259) * 🦺 improve geo ip validation * ✨ geolocation endpoint * ✏️ review comments * ⬆️ publicode (#251) * ⬆️ publicode * 💩 but don't use the engine * 🔖 v1.12.1 * 🩹 return less data on poll simulations (NGC-1783) (#262) * 🔖 v1.12.2 * 🗃️ populate polls funFacts (NGC-1784) (#264) * ♻️ stream poll simulations to not explode memory (NGC-1784) * 🗃️ populate polls funFacts (NGC-1784) * 🔖 v1.12.3 * ♻️ transactions (#266) * ♻️ open a transaction is not a repository job * ♻️ mitigate transaction usage * ✨ update user newsletters (NGC-1727) (#267) * ✨ update user newsletters * ✨ newsletters confirmation * ✨ partners endpoint (NGC-1840) (#268) * ✨ partners endpoint (NGC-1840) * ✨ partners features (NGC-1840) * ♻️ newsletter-confirmation (NGC-1727) (#269) * 🔖 v1.13.0 * ♻️ remove transactions on fetch requests * 🔖 v1.13.1 * 🚑 stop returning all poll simulations * 🔖 v1.13.2 * 🚑 no session in worker * 🔖 v1.13.3 * 🚑 fun facts worker loop (#274) * ♻️ simulation upsert informations on event * ⚰️ remove dashboard endpoint * 🚑 poll funfacts worker do not loop over simulations every time * 🔖 v1.14.0 * 🚑 remove user deduplication transaction * 🔖 v1.14.1 * 🚑 various fixes for performances issues (#277) * 🚑 remove administrator query transaction * 🚑 remove duplicated dedupe user logic * 🔖 v1.14.2 * 🚑 worker polls redis cache (#279) * 🧪 be sure cache is used * ♻️ avoid any query in worker with cache * 🔖 v1.14.3 * ⚡ change slow query * 🔖 v1.14.4 --------- Co-authored-by: Benjamin Arias <bjlaa@proton.me> Co-authored-by: Clément <55186402+Clemog@users.noreply.github.com> * 🛂 rate limiting middleware * ✨ use middleware on create poll simulation --------- Co-authored-by: Benjamin Arias <bjlaa@proton.me> Co-authored-by: Clément <55186402+Clemog@users.noreply.github.com> * 🔖 v1.15.0 * ✨ update user email (NGC-1827) (#282) * ♻️ brevo contact fixture * ✨ update user email (NGC-1827) * 👔 2 tons changes (NGC-1893) (#286) * ✨ be able to deactiivate polls real time stats on big polls (NGC-1892) (#285) * 🗃️ poll computeRealTimeStats migration * ✨ poll computeRealTimeStats (NGC-1892) * ✨ compute poll stats cron (NGC-1892) * ⚡ polls requests memory usage (#287) * 🔖 v1.16.0 * 🩹 cache for brevo newsletters (NGC-1920) (#290) * 🔖 v1.16.1 * ✨ import matomo stats (#292) * 🗃️ stats table * 🔧 2 matomal clients * 🔧 add missing env * ✨ matomo adapters * ✨ add script * ⬆️ model (#293) * 🔖 v1.17.0 * 🩹 consider cache alive in case of timeouts (NGC-1855) (#296) * 🔖 v1.17.1 * ✨ campaign excel stats (NGC-1811) (#295) * 🗃️ jobs table * ✨ download simulations results route (NGC-1811) * ✨ download simulations results worker (NGC-1811) * ✨ download simulations results job (NGC-1811) * 🛂 cannot run job twice and specific to user (NGC-1811) * 🚑 poll funFacts redis cache (#298) * 🔊 debug poll funFacts * 🚑 poll funFacts redis cache * ✏️ missing quote (#299) * 🔖 v1.18.0 * 🩹 textile situation (#302) * 👔 add historical actions (#300) * 👔 add historical actions * 👔 iframe actions and segments * 🩹 nbvisits fallback * 🔖 v1.18.1 * ✨ fix last recovery stats errors and make a cron (#304) * 🩹 handle last stats errors * ✨ make import a CRON (NGC-1779) * 🔖 v1.18.2 * 🐛 Fix additionalQuestions being duplicated on save (#307) * 🐛 Fix additionalQuestions being duplicated on save * ♻️ Remove temp code --------- Co-authored-by: Benjamin Arias <12382534+bjlaa@users.noreply.github.com> * 💚 rest countries api changes (#308) * ⬆️ nosgestesclimat model (#309) * 🔖 v1.19.0 * 📝 database (NGC-1332) (#312) * ✨ store newsletter stats every day (NGC-2045) (#311) * 🗃️ brevo newsletter stats (NGC-2045) * ♻️ enum are bad (NGC-2045) * ✨ store newsletters subscriptions (NGC-2045) * ✨ add cron job (NGC-2045) * 🔖 v1.20.0 * 🔥 remove listId 35 (NGC-1282) (#314) * ✨ 2 links on organisation joined (#315) * 🔖 v1.21.0 * 📦 Update model version (#317) Co-authored-by: Benjamin Arias <12382534+bjlaa@users.noreply.github.com> * ⬆️ dependabot + model (NGC-2173) (#319) * ⬆️ dependabot pass * ⬆️ nosgestesclimat model * 🔥 stats api (#320) * 🔖 v1.23.0 * Revert "⬆️ nosgestesclimat model" (#322) This reverts commit b5fd431. * 🔖 v1.23.1 * ✨ various improvements (#324) * ✏️ bad variable * 🔥 artillery * ⬆️ eslint * 🎨 @typescript-eslint/require-await rule * 🧱 move to esm * ⬆️ esm dependencies * 👔 newsletter confirmation origin (#325) * 👔 pass origin to confirmation email * 👔 use confirmation email origin * ✨ /api/stats route (NGC-2175) (#326) * ➕ replace ts-node * ✨ /api/stats route * 🔖 v1.24.0 * 🚑 production deployment (#328) * 🔥 remove useless AptFile * 🔧 prune devDependencies * 🔥 deprecated APIs * ✅ be sure no http call is unhandled during tests * 🚑 production runtime * 🔖 v1.24.1 * 🔧 stats cron 3AM => 7AM (#330) * 🩹 unknown brevo listIds (NGC-2180) (#332) * 👔 remove funfacts default values (NGC-2251) (#331) * 🔖 v1.24.2 * ✨ add last NL * ✅ all newsletters * 🔥 remove old routes (NGC-1330) (#335) * ⬆️ server update (NGC-2277) (#336) * ♻️ more conventions (MGC-2277) * ⬆️ dependabot pass (NGC-2277) * 🔖 v2.0.0 * 🔧 stats cron 7AM => 9AM (#338) * 🗃️ budget stats (NGC-1926) (#339) * 🗃️ budget stats (NGC-1926) * 🗃️ matomo stats kind (NGC-1926) * ♻️ new enum (NGC-1926) * 🔖 v2.1.0 * ⬆️ upgrade model and publicodes (#341) * ✨ send en emails (NGC-2307) (#342) * ✨ add locale queryParam * ✨ i18n email templates * ✨ send en verification code template * ✨ send en organisation created template * ✨ send en organisation joined template * 🩹 sanitize organisations administrators names (NGC-2309) (#343) * 💚 fix deploy (#344) * 🎨 check typings during lint (#345) * ✨ poll creation email (NGC-2315) (#346) * 🩹 fallback EN for emails (NGC-2307) (#347) * 🩹 correct separator (NGC-2309) (#349) * 🔖 v2.2.0 * ✨ compute polls stats (NGC-2329) (#351) * 🗃️ poll computedResults (NGC-2329) * ♻️ poll funFacts => stats (NGC-2329) * ✨ compute poll computedResults on each participation (NGC-2329) * ✨ compute polls stats migration (NGC-2329) * 🗃️ simulation extended situation (NGC-2239) (#352) * 🔖 v2.3.0 * 🔧 dev command (#355) * 👔 change /api/stats to be non-cumulative (#356) * ✨ poll stats the good way (NGC-2329) (#357) * ✨ increase newsletter code expiration (#358) * ♻️ handle different expiration dates for verification codes * ✨ increase newsletter confirmation expiration * ✅ non regression tests on other verification codes * ✨ receive extendedSituation (NGC-2239) (#353) * ✨ save extendedSituation (NGC-2239) * 🔇 remove extendedSituation from logs (NGC-2239) * 🔖 v2.4.0 * 🩹 change poll participation email url (#362) * 🔖 v2.4.1 --------- Co-authored-by: Benjamin Arias <bjlaa@proton.me> Co-authored-by: Clément <55186402+Clemog@users.noreply.github.com> Co-authored-by: Benjamin Arias <12382534+bjlaa@users.noreply.github.com> Co-authored-by: Clément <clem.auger@hotmail.fr> Co-authored-by: Lilian Saget-Lethias <lilian.sagetlethias@gmail.com>
1 parent c386913 commit e394221

File tree

7 files changed

+30
-8
lines changed

7 files changed

+30
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nosgestesclimat-server",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "The server part of the website nosgestesclimat.fr",
55
"main": "./dist/index.js",
66
"type": "module",

src/adapters/brevo/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +378,21 @@ export const sendPollSimulationUpsertedEmail = async ({
378378
email,
379379
locale,
380380
origin,
381-
organisation: { name, slug },
381+
organisation: { name, slug: organisationSlug },
382+
poll: { slug: pollSlug },
382383
simulation: { id },
383384
}: Readonly<{
384385
email: string
385386
origin: string
386387
locale: Locales
387388
organisation: Pick<Organisation, 'name' | 'slug'>
389+
poll: Pick<Poll, 'slug'>
388390
simulation: Pick<Simulation, 'id'>
389391
}>) => {
390392
const templateId = TemplateIds[locale].ORGANISATION_JOINED
391393

392394
const detailedViewUrl = new URL(
393-
`${origin}/organisations/${slug}/resultats-detailles`
395+
`${origin}/organisations/${organisationSlug}/campagnes/${pollSlug}`
394396
)
395397
const { searchParams: detailedViewUrlSearchParams } = detailedViewUrl
396398
detailedViewUrlSearchParams.append(

src/features/simulations/__tests__/compute-poll-stats.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ describe('Given a poll participation', () => {
9898
created: true,
9999
organisation,
100100
simulation,
101+
poll,
101102
user,
102103
})
103104
})

src/features/simulations/__tests__/create-poll-simulation.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ describe('Given a NGC user', () => {
622622
templateId: 122,
623623
params: {
624624
ORGANISATION_NAME: organisationName,
625-
DETAILED_VIEW_URL: `https://nosgestesclimat.fr/organisations/${organisationSlug}/resultats-detailles?mtm_campaign=email-automatise&mtm_kwd=orga-invite-campagne`,
625+
DETAILED_VIEW_URL: `https://nosgestesclimat.fr/organisations/${organisationSlug}/campagnes/${pollSlug}?mtm_campaign=email-automatise&mtm_kwd=orga-invite-campagne`,
626626
SIMULATION_URL: `https://nosgestesclimat.fr/fin?sid=${payload.id}&mtm_campaign=email-automatise&mtm_kwd=fin-retrouver-simulation`,
627627
},
628628
},
@@ -713,7 +713,7 @@ describe('Given a NGC user', () => {
713713
templateId: 122,
714714
params: {
715715
ORGANISATION_NAME: organisationName,
716-
DETAILED_VIEW_URL: `https://preprod.nosgestesclimat.fr/organisations/${organisationSlug}/resultats-detailles?mtm_campaign=email-automatise&mtm_kwd=orga-invite-campagne`,
716+
DETAILED_VIEW_URL: `https://preprod.nosgestesclimat.fr/organisations/${organisationSlug}/campagnes/${pollSlug}?mtm_campaign=email-automatise&mtm_kwd=orga-invite-campagne`,
717717
SIMULATION_URL: `https://preprod.nosgestesclimat.fr/fin?sid=${payload.id}&mtm_campaign=email-automatise&mtm_kwd=fin-retrouver-simulation`,
718718
},
719719
},
@@ -762,7 +762,7 @@ describe('Given a NGC user', () => {
762762
templateId: 123,
763763
params: {
764764
ORGANISATION_NAME: organisationName,
765-
DETAILED_VIEW_URL: `https://nosgestesclimat.fr/organisations/${organisationSlug}/resultats-detailles?mtm_campaign=email-automatise&mtm_kwd=orga-invite-campagne`,
765+
DETAILED_VIEW_URL: `https://nosgestesclimat.fr/organisations/${organisationSlug}/campagnes/${pollSlug}?mtm_campaign=email-automatise&mtm_kwd=orga-invite-campagne`,
766766
SIMULATION_URL: `https://nosgestesclimat.fr/fin?sid=${payload.id}&mtm_campaign=email-automatise&mtm_kwd=fin-retrouver-simulation`,
767767
},
768768
},

src/features/simulations/events/SimulationUpserted.event.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import type { Group, Organisation, Simulation, User } from '@prisma/client'
1+
import type {
2+
Group,
3+
Organisation,
4+
Poll,
5+
Simulation,
6+
User,
7+
} from '@prisma/client'
28
import { EventBusEvent } from '../../../core/event-bus/event.js'
39
import type { Locales } from '../../../core/i18n/constant.js'
410
import type { ModelToDto } from '../../../types/types.js'
@@ -32,18 +38,21 @@ type SimulationAttributes = BaseSimulationUpsertedEventAttributes &
3238
group?: undefined
3339
administrator?: undefined
3440
organisation?: undefined
41+
poll?: undefined
3542
newsletters: SimulationCreateNewsletterList
3643
}
3744
| {
3845
group: Pick<Group, 'id' | 'name'>
3946
administrator: Pick<User, 'id'>
4047
organisation?: undefined
48+
poll?: undefined
4149
newsletters?: undefined
4250
}
4351
| {
4452
group?: undefined
4553
administrator?: undefined
4654
organisation: Pick<Organisation, 'name' | 'slug'>
55+
poll: Pick<Poll, 'slug'>
4756
newsletters?: undefined
4857
}
4958
)

src/features/simulations/handlers/send-simulation-upserted.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ import type { SimulationUpsertedEvent } from '../events/SimulationUpserted.event
99

1010
export const sendSimulationUpserted: Handler<SimulationUpsertedEvent> = ({
1111
attributes,
12-
attributes: { origin, user, organisation, simulation, sendEmail, locale },
12+
attributes: {
13+
origin,
14+
user,
15+
organisation,
16+
simulation,
17+
sendEmail,
18+
locale,
19+
poll,
20+
},
1321
}) => {
1422
if (!user.email || !sendEmail) {
1523
return
@@ -25,6 +33,7 @@ export const sendSimulationUpserted: Handler<SimulationUpsertedEvent> = ({
2533
locale,
2634
origin,
2735
email,
36+
poll,
2837
})
2938
}
3039

src/features/simulations/simulations.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ export const createPollSimulation = async ({
164164
simulation,
165165
locale,
166166
origin,
167+
poll,
167168
user,
168169
})
169170

0 commit comments

Comments
 (0)