-
Notifications
You must be signed in to change notification settings - Fork 2
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
3042 add field in user #3067
base: develop
Are you sure you want to change the base?
3042 add field in user #3067
Conversation
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.
Ta migration marche :)
Dans l'esprit il faudrait down
qui enlève les champs mais on les utilise presque jamais.
Et la requête est pas écrite de la façon la + simple qui me vient en tête donc je t'écris ce que j'aurais fait. Je ne sais pas dire s'il ce serait mieux en terme de perfs
await collection | ||
.aggregate([ | ||
{ | ||
$addFields: { | ||
from: [], | ||
fromEmail: "", | ||
fromOther: "", | ||
}, | ||
}, | ||
{ $out: "users" }, | ||
]) | ||
.toArray(); |
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.
await collection | |
.aggregate([ | |
{ | |
$addFields: { | |
from: [], | |
fromEmail: "", | |
fromOther: "", | |
}, | |
}, | |
{ $out: "users" }, | |
]) | |
.toArray(); | |
await collection | |
.updateMany({}, { | |
$set: { | |
from: [], | |
fromEmail: "", | |
fromOther: "", | |
} | |
}) |
Les aggregate sont souvent nécessaires pour des choses plus complexes que ça
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 partage la vision d'Alice
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.
@alice-telescoop @mxmeunier et concernant le nom du fichier ?
J'ai mis la date du jour mais le reste j'ai pas réussi à déterminer d'où cela vient.
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.
Les intitulés ne me parlent pas trop. Je te mets des propositions mais c'est subjectif. La vraie chose à faire c'est de mettre des commentaires pour clarifier, que tu changes ou non
@@ -0,0 +1,7 @@ | |||
export enum FromTypeEnum { | |||
INTRODUCTION = "INTRODUCTION", |
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.
INTRODUCTION = "INTRODUCTION", | |
DEMO = "DEMO", |
INTRODUCTION = "INTRODUCTION", | ||
RESEARCH = "RESEARCH", | ||
COLLEAGUES_HIERARCHY = "COLLEAGUES_HIERARCHY", | ||
POST = "POST", |
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.
POST = "POST", | |
SOCIALS = "SOCIALS", |
@@ -0,0 +1,7 @@ | |||
export enum FromTypeEnum { | |||
INTRODUCTION = "INTRODUCTION", | |||
RESEARCH = "RESEARCH", |
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.
RESEARCH = "RESEARCH", | |
OWN_SEARCH = "OWN_SEARCH", |
Celui-là je suis pas convaincue mais RESEARCH
ça m'évoque la recherche scientifique
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.
Ca veut pas dire grand chose je trouve. On parle de quoi, une recherche personnelle sur le navigateur comme "données sur les subventions des associations" avec google ?
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 ce que je comprends mais il faudrait voir avec Marion pour être sûrs
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.
Oui effectivement je suis d'accord @alice-telescoop avec tes idées. J'ai essayé de retranscrire les intitulés des champs mais effectivement pas super parlant.
Pour recherche, dans le front l'intitulé c'est "Via des recherches sur Internet", c'est plutôt moi qui ait mal traduit je pense, est-ce que "SEARCH_ENGINE" ça vous paraît plus cohérent ? @mxmeunier
J'ai cliqué trop vite sur comment et pas approve mais ça me va comme ça |
await collection | ||
.aggregate([ | ||
{ | ||
$addFields: { | ||
from: [], | ||
fromEmail: "", | ||
fromOther: "", | ||
}, | ||
}, | ||
{ $out: "users" }, | ||
]) | ||
.toArray(); |
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 partage la vision d'Alice
}); | ||
expect(actual).toMatchSnapshot(); | ||
}); | ||
it("should return true", () => { |
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.
tu passes pas vraiment de "from" ? C'est biaisé comme test, non ?
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.
Ah oui effectivement... Mieux maintenant ?
@@ -156,6 +156,26 @@ describe("user profile service", () => { | |||
}); | |||
// TODO question : laisser le test comme ça ou extraire des tests ? | |||
}); | |||
|
|||
describe("from", () => { |
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 comprend pas trop le nom du describe. On test plus bas validateUserProfileData
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.
@mxmeunier c'est parce que j'ai nommé le champ en base "from". Est-ce que c'est mieux ?
@@ -0,0 +1,7 @@ | |||
export enum FromTypeEnum { | |||
INTRODUCTION = "INTRODUCTION", | |||
RESEARCH = "RESEARCH", |
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.
Ca veut pas dire grand chose je trouve. On parle de quoi, une recherche personnelle sur le navigateur comme "données sur les subventions des associations" avec google ?
INTRODUCTION = "INTRODUCTION", | ||
RESEARCH = "RESEARCH", | ||
COLLEAGUES_HIERARCHY = "COLLEAGUES_HIERARCHY", | ||
POST = "POST", |
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.
Ca a sûrement été travaillé avec les bizdev, ils entendent quoi derrière chaque mot ? Car POST ça peut être linkedin mais aussi beta.gouv ou n'importe quoi d'autre non ? Il me semblait que le besoin était précis donc pourquoi pas avoir carrément une granularité sur "LINKEDIN" / "NEWSLETTER" / "Facebook" / etc
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.
Tu peux trouver une référence sur la maquette de Marion dans le ticket. Ensuite les mots de l'enum c'est nous qui voyons mais je suis d'accord que je les trouve pas très clairs
closes #3042
@alice-telescoop pas sûre de la migration !