[{"data":1,"prerenderedAt":6026},["ShallowReactive",2],{"/fr/intelligence-artificielle/5-patterns-dangereux-claude":3,"search-api":-1},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"id":10,"date":11,"listed":12,"nocomments":6,"hidden":12,"categories":13,"tags":14,"cover":20,"readingTime":21,"body":26,"_type":6020,"_id":6021,"_source":6022,"_file":6023,"_stem":6024,"_extension":6025},"/fr/intelligence-artificielle/5-patterns-dangereux-claude","intelligence-artificielle",false,"","5 anti-patterns que Claude reproduit en silence dans vos codebases","Cinq patterns dangereux que Claude écrit depuis 2 ans dans des milliers de repos. La liste, les exemples, et les contre-patterns craft à appliquer.",63,"2026-05-07",true,[5],[15,16,17,18,19],"claude-code","anti-patterns","software-craftsmanship","code-review","ia","covers/articles/5-patterns-dangereux-claude.jpg",{"text":22,"minutes":23,"time":24,"words":25},"15 min read",14.52,871200,2904,{"type":27,"children":28,"toc":6008},"root",[29,41,46,50,57,73,78,92,120,123,129,134,139,2233,2282,2294,2297,2303,2316,2329,2867,2919,3418,3423,3426,3432,3453,3928,3933,3945,4544,4557,4562,4565,4571,4576,4862,4875,4896,5332,5352,5355,5361,5398,5410,5431,5444,5447,5453,5458,5632,5637,5640,5653,5656,5662,5667,5784,5796,5799,5805,5810,5815,5820,5833,5836,5848,5851,5857,5872,5892,5935,5948,5974,5987,5990,6002],{"type":30,"tag":31,"props":32,"children":33},"element","p",{},[34],{"type":30,"tag":35,"props":36,"children":37},"strong",{},[38],{"type":39,"value":40},"text","En construisant crmcoaching avec Claude (et au fil de mes accompagnements), j'ai vu Claude reproduire les mêmes 5 patterns à chaque nouvelle fonctionnalité. Copiés-collés sans relecture, ils pourrissent la maintenabilité à bas bruit. Aucun ne fait planter la prod tout de suite. Tous coûtent cher à 12 mois.",{"type":30,"tag":31,"props":42,"children":43},{},[44],{"type":39,"value":45},"Voici les 5 anti-patterns que je vois revenir, pourquoi Claude les écrit, et les contre-patterns craft que j'impose pour les neutraliser. Vous pouvez ouvrir votre repo principal et chercher ces signatures dès lundi matin.",{"type":30,"tag":47,"props":48,"children":49},"hr",{},[],{"type":30,"tag":51,"props":52,"children":54},"h2",{"id":53},"pourquoi-claude-reproduit-certains-patterns-en-silence",[55],{"type":39,"value":56},"Pourquoi Claude reproduit certains patterns en silence",{"type":30,"tag":31,"props":58,"children":59},{},[60,62,71],{"type":39,"value":61},"Le constat de base est documenté. Le ",{"type":30,"tag":63,"props":64,"children":68},"a",{"href":65,"rel":66},"https://www.gitclear.com/ai_assistant_code_quality_2024_research",[67],"nofollow",[69],{"type":39,"value":70},"GitClear AI Copilot Code Quality Report 2024",{"type":39,"value":72}," montre que sur 153 millions de lignes de code analysées, le code \"copié\" (par opposition à refactoré) a augmenté de 8 fois depuis l'arrivée massive des assistants IA dans les workflows de développement. Le code \"moved or refactored\" a baissé de 39%. Les équipes consomment de la suggestion brute et la collent dans leur repo, parfois sans modification.",{"type":30,"tag":31,"props":74,"children":75},{},[76],{"type":39,"value":77},"Ce n'est pas un problème de modèle, c'est un problème de training data. Claude apprend à partir de milliards de lignes de code public. Sur GitHub, le code public est massivement écrit par des juniors, des bibliothèques en alpha, des exemples de tutoriels, des copier-collers de Stack Overflow. Quand vous promptez Claude pour une God Function, il vous en livre une, parce que c'est la moyenne statistique de ce qu'il a vu. Et cette moyenne, comme je l'analyse dans le retour d'expérience sur la code review IA, est très en dessous du standard craft attendu en production sérieuse.",{"type":30,"tag":79,"props":80,"children":81},"blockquote",{},[82],{"type":30,"tag":31,"props":83,"children":84},{},[85,90],{"type":30,"tag":35,"props":86,"children":87},{},[88],{"type":39,"value":89},"Ce que j'ai observé sur crmcoaching",{"type":39,"value":91}," : au fil du développement du CRM, j'ai mesuré le ratio de fonctions de plus de 60 lignes dans les commits que j'acceptais tels quels versus ceux que je repassais en review avant de les intégrer. Sans grille de review active : 22% des fonctions Claude dépassaient ce seuil. Avec re-prompt explicite et review systématique : 4%. La codebase ne s'effondre pas tout de suite, mais le coût de modification grimpe linéairement avec la longueur moyenne des fonctions. À 6 mois, c'était le sujet n°1 de mes sessions de refactoring.",{"type":30,"tag":31,"props":93,"children":94},{},[95,97,103,105,110,112,118],{"type":39,"value":96},"Robert C. Martin l'avait écrit dans ",{"type":30,"tag":98,"props":99,"children":100},"em",{},[101],{"type":39,"value":102},"Clean Code",{"type":39,"value":104}," en 2008 : ",{"type":30,"tag":98,"props":106,"children":107},{},[108],{"type":39,"value":109},"\"The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that.\"",{"type":39,"value":111}," Cette règle, exposée en français dans ",{"type":30,"tag":63,"props":113,"children":115},{"href":114},"/fr/dette-technique/clean-code-software-craftsmanship-principes-java",[116],{"type":39,"value":117},"les principes Clean Code et software craftsmanship",{"type":39,"value":119},", Claude ne l'applique pas par défaut. C'est à vous de la lui imposer par le prompt et la review.",{"type":30,"tag":47,"props":121,"children":122},{},[],{"type":30,"tag":51,"props":124,"children":126},{"id":125},"pattern-1-la-god-function",[127],{"type":39,"value":128},"Pattern #1 : la God Function",{"type":30,"tag":31,"props":130,"children":131},{},[132],{"type":39,"value":133},"C'est le pattern le plus visible. Claude livre une fonction de 60 à 120 lignes qui fait tout : validation, transformation, accès DB, logging, envoi d'événement. Tout dans le même bloc, parce que c'est ce qui ressort statistiquement le plus dans le training data.",{"type":30,"tag":31,"props":135,"children":136},{},[137],{"type":39,"value":138},"Voici un exemple réel que j'ai vu apparaître dans crmcoaching sur la conversion d'un lead en client :",{"type":30,"tag":140,"props":141,"children":145},"pre",{"className":142,"code":143,"language":144,"meta":7,"style":7},"language-typescript shiki shiki-themes catppuccin-frappe github-dark","// apps/api/src/application/use-cases/convert-lead-to-client.use-case.ts\n// Généré par Claude sans prompt de découpe (tel quel)\n\n@Injectable()\nexport class ConvertLeadToClientUseCase {\n  constructor(\n    private readonly prisma: PrismaClient,\n    private readonly brevoService: BrevoService,\n    private readonly auditService: AuditService,\n    private readonly eventEmitter: EventEmitter2,\n  ) {}\n\n  async execute(leadId: string, coachId: string): Promise\u003CClientDto> {\n    // 1. Validation (15 lignes)\n    if (!leadId) throw new BadRequestException('leadId requis');\n    const lead = await this.prisma.lead.findUnique({ where: { id: leadId } });\n    if (!lead) throw new NotFoundException(`Lead ${leadId} introuvable`);\n    if (lead.coachId !== coachId) throw new ForbiddenException('Lead hors scope');\n    if (lead.status === 'CONVERTED') throw new ConflictException('Lead déjà converti');\n    const existingClient = await this.prisma.client.findFirst({\n      where: { email: lead.email, coachId },\n    });\n    if (existingClient) throw new ConflictException('Client existant avec cet email');\n    // ... 8 autres lignes de validation métier\n\n    // 2. Création du client (15 lignes)\n    const client = await this.prisma.client.create({\n      data: {\n        email: lead.email,\n        firstName: lead.firstName,\n        lastName: lead.lastName,\n        phone: lead.phone,\n        coachId,\n        status: 'ACTIVE',\n        createdBy: coachId,\n        convertedFromLeadId: leadId,\n      },\n    });\n    await this.prisma.lead.update({\n      where: { id: leadId },\n      data: { status: 'CONVERTED', convertedAt: new Date(), convertedToClientId: client.id },\n    });\n\n    // 3. Notification Brevo (12 lignes)\n    await this.brevoService.sendTransactionalEmail({\n      to: [{ email: client.email, name: `${client.firstName} ${client.lastName}` }],\n      templateId: 42,\n      params: { firstName: client.firstName, coachName: lead.coachId },\n    });\n    await this.brevoService.addContactToList(client.email, 'clients-actifs');\n\n    // 4. Audit (6 lignes)\n    await this.auditService.log({\n      action: 'LEAD_CONVERTED',\n      entityType: 'client',\n      entityId: client.id,\n      userId: coachId,\n      meta: { fromLeadId: leadId },\n    });\n\n    // 5. Événement domaine (4 lignes)\n    this.eventEmitter.emit('client.created', { clientId: client.id, coachId });\n\n    return ClientDto.fromPrisma(client);\n  }\n}\n","typescript",[146],{"type":30,"tag":147,"props":148,"children":149},"code",{"__ignoreMap":7},[150,162,171,180,202,229,243,279,309,339,369,383,391,477,486,546,661,731,793,859,919,972,989,1031,1040,1048,1057,1115,1132,1161,1191,1221,1251,1264,1286,1307,1329,1338,1354,1400,1432,1518,1534,1542,1551,1589,1709,1732,1799,1815,1874,1882,1891,1929,1951,1973,2003,2024,2058,2074,2082,2091,2176,2183,2215,2224],{"type":30,"tag":151,"props":152,"children":155},"span",{"class":153,"line":154},"line",1,[156],{"type":30,"tag":151,"props":157,"children":159},{"style":158},"--shiki-default:#737994;--shiki-default-font-style:italic;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit",[160],{"type":39,"value":161},"// apps/api/src/application/use-cases/convert-lead-to-client.use-case.ts\n",{"type":30,"tag":151,"props":163,"children":165},{"class":153,"line":164},2,[166],{"type":30,"tag":151,"props":167,"children":168},{"style":158},[169],{"type":39,"value":170},"// Généré par Claude sans prompt de découpe (tel quel)\n",{"type":30,"tag":151,"props":172,"children":174},{"class":153,"line":173},3,[175],{"type":30,"tag":151,"props":176,"children":177},{"emptyLinePlaceholder":12},[178],{"type":39,"value":179},"\n",{"type":30,"tag":151,"props":181,"children":183},{"class":153,"line":182},4,[184,190,196],{"type":30,"tag":151,"props":185,"children":187},{"style":186},"--shiki-default:#8CAAEE;--shiki-default-font-style:italic;--shiki-dark:#E1E4E8;--shiki-dark-font-style:inherit",[188],{"type":39,"value":189},"@",{"type":30,"tag":151,"props":191,"children":193},{"style":192},"--shiki-default:#8CAAEE;--shiki-default-font-style:italic;--shiki-dark:#B392F0;--shiki-dark-font-style:inherit",[194],{"type":39,"value":195},"Injectable",{"type":30,"tag":151,"props":197,"children":199},{"style":198},"--shiki-default:#EF9F76;--shiki-dark:#E1E4E8",[200],{"type":39,"value":201},"()\n",{"type":30,"tag":151,"props":203,"children":205},{"class":153,"line":204},5,[206,212,217,223],{"type":30,"tag":151,"props":207,"children":209},{"style":208},"--shiki-default:#CA9EE6;--shiki-dark:#F97583",[210],{"type":39,"value":211},"export",{"type":30,"tag":151,"props":213,"children":214},{"style":208},[215],{"type":39,"value":216}," class",{"type":30,"tag":151,"props":218,"children":220},{"style":219},"--shiki-default:#E5C890;--shiki-default-font-style:italic;--shiki-dark:#B392F0;--shiki-dark-font-style:inherit",[221],{"type":39,"value":222}," ConvertLeadToClientUseCase",{"type":30,"tag":151,"props":224,"children":226},{"style":225},"--shiki-default:#949CBB;--shiki-dark:#E1E4E8",[227],{"type":39,"value":228}," {\n",{"type":30,"tag":151,"props":230,"children":232},{"class":153,"line":231},6,[233,238],{"type":30,"tag":151,"props":234,"children":235},{"style":208},[236],{"type":39,"value":237},"  constructor",{"type":30,"tag":151,"props":239,"children":240},{"style":225},[241],{"type":39,"value":242},"(\n",{"type":30,"tag":151,"props":244,"children":246},{"class":153,"line":245},7,[247,252,257,263,269,274],{"type":30,"tag":151,"props":248,"children":249},{"style":208},[250],{"type":39,"value":251},"    private",{"type":30,"tag":151,"props":253,"children":254},{"style":208},[255],{"type":39,"value":256}," readonly",{"type":30,"tag":151,"props":258,"children":260},{"style":259},"--shiki-default:#EA999C;--shiki-default-font-style:italic;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit",[261],{"type":39,"value":262}," prisma",{"type":30,"tag":151,"props":264,"children":266},{"style":265},"--shiki-default:#81C8BE;--shiki-dark:#F97583",[267],{"type":39,"value":268},":",{"type":30,"tag":151,"props":270,"children":271},{"style":219},[272],{"type":39,"value":273}," PrismaClient",{"type":30,"tag":151,"props":275,"children":276},{"style":225},[277],{"type":39,"value":278},",\n",{"type":30,"tag":151,"props":280,"children":282},{"class":153,"line":281},8,[283,287,291,296,300,305],{"type":30,"tag":151,"props":284,"children":285},{"style":208},[286],{"type":39,"value":251},{"type":30,"tag":151,"props":288,"children":289},{"style":208},[290],{"type":39,"value":256},{"type":30,"tag":151,"props":292,"children":293},{"style":259},[294],{"type":39,"value":295}," brevoService",{"type":30,"tag":151,"props":297,"children":298},{"style":265},[299],{"type":39,"value":268},{"type":30,"tag":151,"props":301,"children":302},{"style":219},[303],{"type":39,"value":304}," BrevoService",{"type":30,"tag":151,"props":306,"children":307},{"style":225},[308],{"type":39,"value":278},{"type":30,"tag":151,"props":310,"children":312},{"class":153,"line":311},9,[313,317,321,326,330,335],{"type":30,"tag":151,"props":314,"children":315},{"style":208},[316],{"type":39,"value":251},{"type":30,"tag":151,"props":318,"children":319},{"style":208},[320],{"type":39,"value":256},{"type":30,"tag":151,"props":322,"children":323},{"style":259},[324],{"type":39,"value":325}," auditService",{"type":30,"tag":151,"props":327,"children":328},{"style":265},[329],{"type":39,"value":268},{"type":30,"tag":151,"props":331,"children":332},{"style":219},[333],{"type":39,"value":334}," AuditService",{"type":30,"tag":151,"props":336,"children":337},{"style":225},[338],{"type":39,"value":278},{"type":30,"tag":151,"props":340,"children":342},{"class":153,"line":341},10,[343,347,351,356,360,365],{"type":30,"tag":151,"props":344,"children":345},{"style":208},[346],{"type":39,"value":251},{"type":30,"tag":151,"props":348,"children":349},{"style":208},[350],{"type":39,"value":256},{"type":30,"tag":151,"props":352,"children":353},{"style":259},[354],{"type":39,"value":355}," eventEmitter",{"type":30,"tag":151,"props":357,"children":358},{"style":265},[359],{"type":39,"value":268},{"type":30,"tag":151,"props":361,"children":362},{"style":219},[363],{"type":39,"value":364}," EventEmitter2",{"type":30,"tag":151,"props":366,"children":367},{"style":225},[368],{"type":39,"value":278},{"type":30,"tag":151,"props":370,"children":372},{"class":153,"line":371},11,[373,378],{"type":30,"tag":151,"props":374,"children":375},{"style":225},[376],{"type":39,"value":377},"  )",{"type":30,"tag":151,"props":379,"children":380},{"style":225},[381],{"type":39,"value":382}," {}\n",{"type":30,"tag":151,"props":384,"children":386},{"class":153,"line":385},12,[387],{"type":30,"tag":151,"props":388,"children":389},{"emptyLinePlaceholder":12},[390],{"type":39,"value":179},{"type":30,"tag":151,"props":392,"children":394},{"class":153,"line":393},13,[395,400,405,410,415,419,425,430,435,439,443,448,452,457,463,468,473],{"type":30,"tag":151,"props":396,"children":397},{"style":208},[398],{"type":39,"value":399},"  async",{"type":30,"tag":151,"props":401,"children":402},{"style":192},[403],{"type":39,"value":404}," execute",{"type":30,"tag":151,"props":406,"children":407},{"style":225},[408],{"type":39,"value":409},"(",{"type":30,"tag":151,"props":411,"children":412},{"style":259},[413],{"type":39,"value":414},"leadId",{"type":30,"tag":151,"props":416,"children":417},{"style":265},[418],{"type":39,"value":268},{"type":30,"tag":151,"props":420,"children":422},{"style":421},"--shiki-default:#CA9EE6;--shiki-dark:#79B8FF",[423],{"type":39,"value":424}," string",{"type":30,"tag":151,"props":426,"children":427},{"style":225},[428],{"type":39,"value":429},",",{"type":30,"tag":151,"props":431,"children":432},{"style":259},[433],{"type":39,"value":434}," coachId",{"type":30,"tag":151,"props":436,"children":437},{"style":265},[438],{"type":39,"value":268},{"type":30,"tag":151,"props":440,"children":441},{"style":421},[442],{"type":39,"value":424},{"type":30,"tag":151,"props":444,"children":445},{"style":225},[446],{"type":39,"value":447},")",{"type":30,"tag":151,"props":449,"children":450},{"style":265},[451],{"type":39,"value":268},{"type":30,"tag":151,"props":453,"children":454},{"style":219},[455],{"type":39,"value":456}," Promise",{"type":30,"tag":151,"props":458,"children":460},{"style":459},"--shiki-default:#99D1DB;--shiki-dark:#E1E4E8",[461],{"type":39,"value":462},"\u003C",{"type":30,"tag":151,"props":464,"children":465},{"style":219},[466],{"type":39,"value":467},"ClientDto",{"type":30,"tag":151,"props":469,"children":470},{"style":459},[471],{"type":39,"value":472},">",{"type":30,"tag":151,"props":474,"children":475},{"style":225},[476],{"type":39,"value":228},{"type":30,"tag":151,"props":478,"children":480},{"class":153,"line":479},14,[481],{"type":30,"tag":151,"props":482,"children":483},{"style":158},[484],{"type":39,"value":485},"    // 1. Validation (15 lignes)\n",{"type":30,"tag":151,"props":487,"children":489},{"class":153,"line":488},15,[490,495,501,506,511,516,522,527,531,537,541],{"type":30,"tag":151,"props":491,"children":492},{"style":208},[493],{"type":39,"value":494},"    if",{"type":30,"tag":151,"props":496,"children":498},{"style":497},"--shiki-default:#C6D0F5;--shiki-dark:#E1E4E8",[499],{"type":39,"value":500}," (",{"type":30,"tag":151,"props":502,"children":503},{"style":265},[504],{"type":39,"value":505},"!",{"type":30,"tag":151,"props":507,"children":508},{"style":497},[509],{"type":39,"value":510},"leadId) ",{"type":30,"tag":151,"props":512,"children":513},{"style":208},[514],{"type":39,"value":515},"throw",{"type":30,"tag":151,"props":517,"children":519},{"style":518},"--shiki-default:#CA9EE6;--shiki-default-font-weight:bold;--shiki-dark:#F97583;--shiki-dark-font-weight:inherit",[520],{"type":39,"value":521}," new",{"type":30,"tag":151,"props":523,"children":524},{"style":192},[525],{"type":39,"value":526}," BadRequestException",{"type":30,"tag":151,"props":528,"children":529},{"style":497},[530],{"type":39,"value":409},{"type":30,"tag":151,"props":532,"children":534},{"style":533},"--shiki-default:#A6D189;--shiki-dark:#9ECBFF",[535],{"type":39,"value":536},"'leadId requis'",{"type":30,"tag":151,"props":538,"children":539},{"style":497},[540],{"type":39,"value":447},{"type":30,"tag":151,"props":542,"children":543},{"style":225},[544],{"type":39,"value":545},";\n",{"type":30,"tag":151,"props":547,"children":549},{"class":153,"line":548},16,[550,555,561,566,571,577,583,588,592,597,601,606,610,615,620,624,629,634,638,643,648,653,657],{"type":30,"tag":151,"props":551,"children":552},{"style":208},[553],{"type":39,"value":554},"    const",{"type":30,"tag":151,"props":556,"children":558},{"style":557},"--shiki-default:#C6D0F5;--shiki-dark:#79B8FF",[559],{"type":39,"value":560}," lead",{"type":30,"tag":151,"props":562,"children":563},{"style":265},[564],{"type":39,"value":565}," =",{"type":30,"tag":151,"props":567,"children":568},{"style":208},[569],{"type":39,"value":570}," await",{"type":30,"tag":151,"props":572,"children":574},{"style":573},"--shiki-default:#E78284;--shiki-dark:#79B8FF",[575],{"type":39,"value":576}," this",{"type":30,"tag":151,"props":578,"children":580},{"style":579},"--shiki-default:#81C8BE;--shiki-dark:#E1E4E8",[581],{"type":39,"value":582},".",{"type":30,"tag":151,"props":584,"children":585},{"style":497},[586],{"type":39,"value":587},"prisma",{"type":30,"tag":151,"props":589,"children":590},{"style":579},[591],{"type":39,"value":582},{"type":30,"tag":151,"props":593,"children":594},{"style":497},[595],{"type":39,"value":596},"lead",{"type":30,"tag":151,"props":598,"children":599},{"style":579},[600],{"type":39,"value":582},{"type":30,"tag":151,"props":602,"children":603},{"style":192},[604],{"type":39,"value":605},"findUnique",{"type":30,"tag":151,"props":607,"children":608},{"style":497},[609],{"type":39,"value":409},{"type":30,"tag":151,"props":611,"children":612},{"style":225},[613],{"type":39,"value":614},"{",{"type":30,"tag":151,"props":616,"children":617},{"style":497},[618],{"type":39,"value":619}," where",{"type":30,"tag":151,"props":621,"children":622},{"style":579},[623],{"type":39,"value":268},{"type":30,"tag":151,"props":625,"children":626},{"style":225},[627],{"type":39,"value":628}," {",{"type":30,"tag":151,"props":630,"children":631},{"style":497},[632],{"type":39,"value":633}," id",{"type":30,"tag":151,"props":635,"children":636},{"style":579},[637],{"type":39,"value":268},{"type":30,"tag":151,"props":639,"children":640},{"style":497},[641],{"type":39,"value":642}," leadId ",{"type":30,"tag":151,"props":644,"children":645},{"style":225},[646],{"type":39,"value":647},"}",{"type":30,"tag":151,"props":649,"children":650},{"style":225},[651],{"type":39,"value":652}," }",{"type":30,"tag":151,"props":654,"children":655},{"style":497},[656],{"type":39,"value":447},{"type":30,"tag":151,"props":658,"children":659},{"style":225},[660],{"type":39,"value":545},{"type":30,"tag":151,"props":662,"children":664},{"class":153,"line":663},17,[665,669,673,677,682,686,690,695,699,704,710,714,718,723,727],{"type":30,"tag":151,"props":666,"children":667},{"style":208},[668],{"type":39,"value":494},{"type":30,"tag":151,"props":670,"children":671},{"style":497},[672],{"type":39,"value":500},{"type":30,"tag":151,"props":674,"children":675},{"style":265},[676],{"type":39,"value":505},{"type":30,"tag":151,"props":678,"children":679},{"style":497},[680],{"type":39,"value":681},"lead) ",{"type":30,"tag":151,"props":683,"children":684},{"style":208},[685],{"type":39,"value":515},{"type":30,"tag":151,"props":687,"children":688},{"style":518},[689],{"type":39,"value":521},{"type":30,"tag":151,"props":691,"children":692},{"style":192},[693],{"type":39,"value":694}," NotFoundException",{"type":30,"tag":151,"props":696,"children":697},{"style":497},[698],{"type":39,"value":409},{"type":30,"tag":151,"props":700,"children":701},{"style":533},[702],{"type":39,"value":703},"`Lead ",{"type":30,"tag":151,"props":705,"children":707},{"style":706},"--shiki-default:#949CBB;--shiki-dark:#9ECBFF",[708],{"type":39,"value":709},"${",{"type":30,"tag":151,"props":711,"children":712},{"style":497},[713],{"type":39,"value":414},{"type":30,"tag":151,"props":715,"children":716},{"style":706},[717],{"type":39,"value":647},{"type":30,"tag":151,"props":719,"children":720},{"style":533},[721],{"type":39,"value":722}," introuvable`",{"type":30,"tag":151,"props":724,"children":725},{"style":497},[726],{"type":39,"value":447},{"type":30,"tag":151,"props":728,"children":729},{"style":225},[730],{"type":39,"value":545},{"type":30,"tag":151,"props":732,"children":734},{"class":153,"line":733},18,[735,739,744,748,753,758,763,767,771,776,780,785,789],{"type":30,"tag":151,"props":736,"children":737},{"style":208},[738],{"type":39,"value":494},{"type":30,"tag":151,"props":740,"children":741},{"style":497},[742],{"type":39,"value":743}," (lead",{"type":30,"tag":151,"props":745,"children":746},{"style":579},[747],{"type":39,"value":582},{"type":30,"tag":151,"props":749,"children":750},{"style":497},[751],{"type":39,"value":752},"coachId ",{"type":30,"tag":151,"props":754,"children":755},{"style":265},[756],{"type":39,"value":757},"!==",{"type":30,"tag":151,"props":759,"children":760},{"style":497},[761],{"type":39,"value":762}," coachId) ",{"type":30,"tag":151,"props":764,"children":765},{"style":208},[766],{"type":39,"value":515},{"type":30,"tag":151,"props":768,"children":769},{"style":518},[770],{"type":39,"value":521},{"type":30,"tag":151,"props":772,"children":773},{"style":192},[774],{"type":39,"value":775}," ForbiddenException",{"type":30,"tag":151,"props":777,"children":778},{"style":497},[779],{"type":39,"value":409},{"type":30,"tag":151,"props":781,"children":782},{"style":533},[783],{"type":39,"value":784},"'Lead hors scope'",{"type":30,"tag":151,"props":786,"children":787},{"style":497},[788],{"type":39,"value":447},{"type":30,"tag":151,"props":790,"children":791},{"style":225},[792],{"type":39,"value":545},{"type":30,"tag":151,"props":794,"children":796},{"class":153,"line":795},19,[797,801,805,809,814,819,824,829,833,837,842,846,851,855],{"type":30,"tag":151,"props":798,"children":799},{"style":208},[800],{"type":39,"value":494},{"type":30,"tag":151,"props":802,"children":803},{"style":497},[804],{"type":39,"value":743},{"type":30,"tag":151,"props":806,"children":807},{"style":579},[808],{"type":39,"value":582},{"type":30,"tag":151,"props":810,"children":811},{"style":497},[812],{"type":39,"value":813},"status ",{"type":30,"tag":151,"props":815,"children":816},{"style":265},[817],{"type":39,"value":818},"===",{"type":30,"tag":151,"props":820,"children":821},{"style":533},[822],{"type":39,"value":823}," 'CONVERTED'",{"type":30,"tag":151,"props":825,"children":826},{"style":497},[827],{"type":39,"value":828},") ",{"type":30,"tag":151,"props":830,"children":831},{"style":208},[832],{"type":39,"value":515},{"type":30,"tag":151,"props":834,"children":835},{"style":518},[836],{"type":39,"value":521},{"type":30,"tag":151,"props":838,"children":839},{"style":192},[840],{"type":39,"value":841}," ConflictException",{"type":30,"tag":151,"props":843,"children":844},{"style":497},[845],{"type":39,"value":409},{"type":30,"tag":151,"props":847,"children":848},{"style":533},[849],{"type":39,"value":850},"'Lead déjà converti'",{"type":30,"tag":151,"props":852,"children":853},{"style":497},[854],{"type":39,"value":447},{"type":30,"tag":151,"props":856,"children":857},{"style":225},[858],{"type":39,"value":545},{"type":30,"tag":151,"props":860,"children":862},{"class":153,"line":861},20,[863,867,872,876,880,884,888,892,896,901,905,910,914],{"type":30,"tag":151,"props":864,"children":865},{"style":208},[866],{"type":39,"value":554},{"type":30,"tag":151,"props":868,"children":869},{"style":557},[870],{"type":39,"value":871}," existingClient",{"type":30,"tag":151,"props":873,"children":874},{"style":265},[875],{"type":39,"value":565},{"type":30,"tag":151,"props":877,"children":878},{"style":208},[879],{"type":39,"value":570},{"type":30,"tag":151,"props":881,"children":882},{"style":573},[883],{"type":39,"value":576},{"type":30,"tag":151,"props":885,"children":886},{"style":579},[887],{"type":39,"value":582},{"type":30,"tag":151,"props":889,"children":890},{"style":497},[891],{"type":39,"value":587},{"type":30,"tag":151,"props":893,"children":894},{"style":579},[895],{"type":39,"value":582},{"type":30,"tag":151,"props":897,"children":898},{"style":497},[899],{"type":39,"value":900},"client",{"type":30,"tag":151,"props":902,"children":903},{"style":579},[904],{"type":39,"value":582},{"type":30,"tag":151,"props":906,"children":907},{"style":192},[908],{"type":39,"value":909},"findFirst",{"type":30,"tag":151,"props":911,"children":912},{"style":497},[913],{"type":39,"value":409},{"type":30,"tag":151,"props":915,"children":916},{"style":225},[917],{"type":39,"value":918},"{\n",{"type":30,"tag":151,"props":920,"children":922},{"class":153,"line":921},21,[923,928,932,936,941,945,949,953,958,962,967],{"type":30,"tag":151,"props":924,"children":925},{"style":497},[926],{"type":39,"value":927},"      where",{"type":30,"tag":151,"props":929,"children":930},{"style":579},[931],{"type":39,"value":268},{"type":30,"tag":151,"props":933,"children":934},{"style":225},[935],{"type":39,"value":628},{"type":30,"tag":151,"props":937,"children":938},{"style":497},[939],{"type":39,"value":940}," email",{"type":30,"tag":151,"props":942,"children":943},{"style":579},[944],{"type":39,"value":268},{"type":30,"tag":151,"props":946,"children":947},{"style":497},[948],{"type":39,"value":560},{"type":30,"tag":151,"props":950,"children":951},{"style":579},[952],{"type":39,"value":582},{"type":30,"tag":151,"props":954,"children":955},{"style":497},[956],{"type":39,"value":957},"email",{"type":30,"tag":151,"props":959,"children":960},{"style":225},[961],{"type":39,"value":429},{"type":30,"tag":151,"props":963,"children":964},{"style":497},[965],{"type":39,"value":966}," coachId ",{"type":30,"tag":151,"props":968,"children":969},{"style":225},[970],{"type":39,"value":971},"},\n",{"type":30,"tag":151,"props":973,"children":975},{"class":153,"line":974},22,[976,981,985],{"type":30,"tag":151,"props":977,"children":978},{"style":225},[979],{"type":39,"value":980},"    }",{"type":30,"tag":151,"props":982,"children":983},{"style":497},[984],{"type":39,"value":447},{"type":30,"tag":151,"props":986,"children":987},{"style":225},[988],{"type":39,"value":545},{"type":30,"tag":151,"props":990,"children":992},{"class":153,"line":991},23,[993,997,1002,1006,1010,1014,1018,1023,1027],{"type":30,"tag":151,"props":994,"children":995},{"style":208},[996],{"type":39,"value":494},{"type":30,"tag":151,"props":998,"children":999},{"style":497},[1000],{"type":39,"value":1001}," (existingClient) ",{"type":30,"tag":151,"props":1003,"children":1004},{"style":208},[1005],{"type":39,"value":515},{"type":30,"tag":151,"props":1007,"children":1008},{"style":518},[1009],{"type":39,"value":521},{"type":30,"tag":151,"props":1011,"children":1012},{"style":192},[1013],{"type":39,"value":841},{"type":30,"tag":151,"props":1015,"children":1016},{"style":497},[1017],{"type":39,"value":409},{"type":30,"tag":151,"props":1019,"children":1020},{"style":533},[1021],{"type":39,"value":1022},"'Client existant avec cet email'",{"type":30,"tag":151,"props":1024,"children":1025},{"style":497},[1026],{"type":39,"value":447},{"type":30,"tag":151,"props":1028,"children":1029},{"style":225},[1030],{"type":39,"value":545},{"type":30,"tag":151,"props":1032,"children":1034},{"class":153,"line":1033},24,[1035],{"type":30,"tag":151,"props":1036,"children":1037},{"style":158},[1038],{"type":39,"value":1039},"    // ... 8 autres lignes de validation métier\n",{"type":30,"tag":151,"props":1041,"children":1043},{"class":153,"line":1042},25,[1044],{"type":30,"tag":151,"props":1045,"children":1046},{"emptyLinePlaceholder":12},[1047],{"type":39,"value":179},{"type":30,"tag":151,"props":1049,"children":1051},{"class":153,"line":1050},26,[1052],{"type":30,"tag":151,"props":1053,"children":1054},{"style":158},[1055],{"type":39,"value":1056},"    // 2. Création du client (15 lignes)\n",{"type":30,"tag":151,"props":1058,"children":1060},{"class":153,"line":1059},27,[1061,1065,1070,1074,1078,1082,1086,1090,1094,1098,1102,1107,1111],{"type":30,"tag":151,"props":1062,"children":1063},{"style":208},[1064],{"type":39,"value":554},{"type":30,"tag":151,"props":1066,"children":1067},{"style":557},[1068],{"type":39,"value":1069}," client",{"type":30,"tag":151,"props":1071,"children":1072},{"style":265},[1073],{"type":39,"value":565},{"type":30,"tag":151,"props":1075,"children":1076},{"style":208},[1077],{"type":39,"value":570},{"type":30,"tag":151,"props":1079,"children":1080},{"style":573},[1081],{"type":39,"value":576},{"type":30,"tag":151,"props":1083,"children":1084},{"style":579},[1085],{"type":39,"value":582},{"type":30,"tag":151,"props":1087,"children":1088},{"style":497},[1089],{"type":39,"value":587},{"type":30,"tag":151,"props":1091,"children":1092},{"style":579},[1093],{"type":39,"value":582},{"type":30,"tag":151,"props":1095,"children":1096},{"style":497},[1097],{"type":39,"value":900},{"type":30,"tag":151,"props":1099,"children":1100},{"style":579},[1101],{"type":39,"value":582},{"type":30,"tag":151,"props":1103,"children":1104},{"style":192},[1105],{"type":39,"value":1106},"create",{"type":30,"tag":151,"props":1108,"children":1109},{"style":497},[1110],{"type":39,"value":409},{"type":30,"tag":151,"props":1112,"children":1113},{"style":225},[1114],{"type":39,"value":918},{"type":30,"tag":151,"props":1116,"children":1118},{"class":153,"line":1117},28,[1119,1124,1128],{"type":30,"tag":151,"props":1120,"children":1121},{"style":497},[1122],{"type":39,"value":1123},"      data",{"type":30,"tag":151,"props":1125,"children":1126},{"style":579},[1127],{"type":39,"value":268},{"type":30,"tag":151,"props":1129,"children":1130},{"style":225},[1131],{"type":39,"value":228},{"type":30,"tag":151,"props":1133,"children":1135},{"class":153,"line":1134},29,[1136,1141,1145,1149,1153,1157],{"type":30,"tag":151,"props":1137,"children":1138},{"style":497},[1139],{"type":39,"value":1140},"        email",{"type":30,"tag":151,"props":1142,"children":1143},{"style":579},[1144],{"type":39,"value":268},{"type":30,"tag":151,"props":1146,"children":1147},{"style":497},[1148],{"type":39,"value":560},{"type":30,"tag":151,"props":1150,"children":1151},{"style":579},[1152],{"type":39,"value":582},{"type":30,"tag":151,"props":1154,"children":1155},{"style":497},[1156],{"type":39,"value":957},{"type":30,"tag":151,"props":1158,"children":1159},{"style":225},[1160],{"type":39,"value":278},{"type":30,"tag":151,"props":1162,"children":1164},{"class":153,"line":1163},30,[1165,1170,1174,1178,1182,1187],{"type":30,"tag":151,"props":1166,"children":1167},{"style":497},[1168],{"type":39,"value":1169},"        firstName",{"type":30,"tag":151,"props":1171,"children":1172},{"style":579},[1173],{"type":39,"value":268},{"type":30,"tag":151,"props":1175,"children":1176},{"style":497},[1177],{"type":39,"value":560},{"type":30,"tag":151,"props":1179,"children":1180},{"style":579},[1181],{"type":39,"value":582},{"type":30,"tag":151,"props":1183,"children":1184},{"style":497},[1185],{"type":39,"value":1186},"firstName",{"type":30,"tag":151,"props":1188,"children":1189},{"style":225},[1190],{"type":39,"value":278},{"type":30,"tag":151,"props":1192,"children":1194},{"class":153,"line":1193},31,[1195,1200,1204,1208,1212,1217],{"type":30,"tag":151,"props":1196,"children":1197},{"style":497},[1198],{"type":39,"value":1199},"        lastName",{"type":30,"tag":151,"props":1201,"children":1202},{"style":579},[1203],{"type":39,"value":268},{"type":30,"tag":151,"props":1205,"children":1206},{"style":497},[1207],{"type":39,"value":560},{"type":30,"tag":151,"props":1209,"children":1210},{"style":579},[1211],{"type":39,"value":582},{"type":30,"tag":151,"props":1213,"children":1214},{"style":497},[1215],{"type":39,"value":1216},"lastName",{"type":30,"tag":151,"props":1218,"children":1219},{"style":225},[1220],{"type":39,"value":278},{"type":30,"tag":151,"props":1222,"children":1224},{"class":153,"line":1223},32,[1225,1230,1234,1238,1242,1247],{"type":30,"tag":151,"props":1226,"children":1227},{"style":497},[1228],{"type":39,"value":1229},"        phone",{"type":30,"tag":151,"props":1231,"children":1232},{"style":579},[1233],{"type":39,"value":268},{"type":30,"tag":151,"props":1235,"children":1236},{"style":497},[1237],{"type":39,"value":560},{"type":30,"tag":151,"props":1239,"children":1240},{"style":579},[1241],{"type":39,"value":582},{"type":30,"tag":151,"props":1243,"children":1244},{"style":497},[1245],{"type":39,"value":1246},"phone",{"type":30,"tag":151,"props":1248,"children":1249},{"style":225},[1250],{"type":39,"value":278},{"type":30,"tag":151,"props":1252,"children":1254},{"class":153,"line":1253},33,[1255,1260],{"type":30,"tag":151,"props":1256,"children":1257},{"style":497},[1258],{"type":39,"value":1259},"        coachId",{"type":30,"tag":151,"props":1261,"children":1262},{"style":225},[1263],{"type":39,"value":278},{"type":30,"tag":151,"props":1265,"children":1267},{"class":153,"line":1266},34,[1268,1273,1277,1282],{"type":30,"tag":151,"props":1269,"children":1270},{"style":497},[1271],{"type":39,"value":1272},"        status",{"type":30,"tag":151,"props":1274,"children":1275},{"style":579},[1276],{"type":39,"value":268},{"type":30,"tag":151,"props":1278,"children":1279},{"style":533},[1280],{"type":39,"value":1281}," 'ACTIVE'",{"type":30,"tag":151,"props":1283,"children":1284},{"style":225},[1285],{"type":39,"value":278},{"type":30,"tag":151,"props":1287,"children":1289},{"class":153,"line":1288},35,[1290,1295,1299,1303],{"type":30,"tag":151,"props":1291,"children":1292},{"style":497},[1293],{"type":39,"value":1294},"        createdBy",{"type":30,"tag":151,"props":1296,"children":1297},{"style":579},[1298],{"type":39,"value":268},{"type":30,"tag":151,"props":1300,"children":1301},{"style":497},[1302],{"type":39,"value":434},{"type":30,"tag":151,"props":1304,"children":1305},{"style":225},[1306],{"type":39,"value":278},{"type":30,"tag":151,"props":1308,"children":1310},{"class":153,"line":1309},36,[1311,1316,1320,1325],{"type":30,"tag":151,"props":1312,"children":1313},{"style":497},[1314],{"type":39,"value":1315},"        convertedFromLeadId",{"type":30,"tag":151,"props":1317,"children":1318},{"style":579},[1319],{"type":39,"value":268},{"type":30,"tag":151,"props":1321,"children":1322},{"style":497},[1323],{"type":39,"value":1324}," leadId",{"type":30,"tag":151,"props":1326,"children":1327},{"style":225},[1328],{"type":39,"value":278},{"type":30,"tag":151,"props":1330,"children":1332},{"class":153,"line":1331},37,[1333],{"type":30,"tag":151,"props":1334,"children":1335},{"style":225},[1336],{"type":39,"value":1337},"      },\n",{"type":30,"tag":151,"props":1339,"children":1341},{"class":153,"line":1340},38,[1342,1346,1350],{"type":30,"tag":151,"props":1343,"children":1344},{"style":225},[1345],{"type":39,"value":980},{"type":30,"tag":151,"props":1347,"children":1348},{"style":497},[1349],{"type":39,"value":447},{"type":30,"tag":151,"props":1351,"children":1352},{"style":225},[1353],{"type":39,"value":545},{"type":30,"tag":151,"props":1355,"children":1357},{"class":153,"line":1356},39,[1358,1363,1367,1371,1375,1379,1383,1387,1392,1396],{"type":30,"tag":151,"props":1359,"children":1360},{"style":208},[1361],{"type":39,"value":1362},"    await",{"type":30,"tag":151,"props":1364,"children":1365},{"style":573},[1366],{"type":39,"value":576},{"type":30,"tag":151,"props":1368,"children":1369},{"style":579},[1370],{"type":39,"value":582},{"type":30,"tag":151,"props":1372,"children":1373},{"style":497},[1374],{"type":39,"value":587},{"type":30,"tag":151,"props":1376,"children":1377},{"style":579},[1378],{"type":39,"value":582},{"type":30,"tag":151,"props":1380,"children":1381},{"style":497},[1382],{"type":39,"value":596},{"type":30,"tag":151,"props":1384,"children":1385},{"style":579},[1386],{"type":39,"value":582},{"type":30,"tag":151,"props":1388,"children":1389},{"style":192},[1390],{"type":39,"value":1391},"update",{"type":30,"tag":151,"props":1393,"children":1394},{"style":497},[1395],{"type":39,"value":409},{"type":30,"tag":151,"props":1397,"children":1398},{"style":225},[1399],{"type":39,"value":918},{"type":30,"tag":151,"props":1401,"children":1403},{"class":153,"line":1402},40,[1404,1408,1412,1416,1420,1424,1428],{"type":30,"tag":151,"props":1405,"children":1406},{"style":497},[1407],{"type":39,"value":927},{"type":30,"tag":151,"props":1409,"children":1410},{"style":579},[1411],{"type":39,"value":268},{"type":30,"tag":151,"props":1413,"children":1414},{"style":225},[1415],{"type":39,"value":628},{"type":30,"tag":151,"props":1417,"children":1418},{"style":497},[1419],{"type":39,"value":633},{"type":30,"tag":151,"props":1421,"children":1422},{"style":579},[1423],{"type":39,"value":268},{"type":30,"tag":151,"props":1425,"children":1426},{"style":497},[1427],{"type":39,"value":642},{"type":30,"tag":151,"props":1429,"children":1430},{"style":225},[1431],{"type":39,"value":971},{"type":30,"tag":151,"props":1433,"children":1435},{"class":153,"line":1434},41,[1436,1440,1444,1448,1453,1457,1461,1465,1470,1474,1478,1483,1488,1492,1497,1501,1505,1509,1514],{"type":30,"tag":151,"props":1437,"children":1438},{"style":497},[1439],{"type":39,"value":1123},{"type":30,"tag":151,"props":1441,"children":1442},{"style":579},[1443],{"type":39,"value":268},{"type":30,"tag":151,"props":1445,"children":1446},{"style":225},[1447],{"type":39,"value":628},{"type":30,"tag":151,"props":1449,"children":1450},{"style":497},[1451],{"type":39,"value":1452}," status",{"type":30,"tag":151,"props":1454,"children":1455},{"style":579},[1456],{"type":39,"value":268},{"type":30,"tag":151,"props":1458,"children":1459},{"style":533},[1460],{"type":39,"value":823},{"type":30,"tag":151,"props":1462,"children":1463},{"style":225},[1464],{"type":39,"value":429},{"type":30,"tag":151,"props":1466,"children":1467},{"style":497},[1468],{"type":39,"value":1469}," convertedAt",{"type":30,"tag":151,"props":1471,"children":1472},{"style":579},[1473],{"type":39,"value":268},{"type":30,"tag":151,"props":1475,"children":1476},{"style":518},[1477],{"type":39,"value":521},{"type":30,"tag":151,"props":1479,"children":1480},{"style":192},[1481],{"type":39,"value":1482}," Date",{"type":30,"tag":151,"props":1484,"children":1485},{"style":497},[1486],{"type":39,"value":1487},"()",{"type":30,"tag":151,"props":1489,"children":1490},{"style":225},[1491],{"type":39,"value":429},{"type":30,"tag":151,"props":1493,"children":1494},{"style":497},[1495],{"type":39,"value":1496}," convertedToClientId",{"type":30,"tag":151,"props":1498,"children":1499},{"style":579},[1500],{"type":39,"value":268},{"type":30,"tag":151,"props":1502,"children":1503},{"style":497},[1504],{"type":39,"value":1069},{"type":30,"tag":151,"props":1506,"children":1507},{"style":579},[1508],{"type":39,"value":582},{"type":30,"tag":151,"props":1510,"children":1511},{"style":497},[1512],{"type":39,"value":1513},"id ",{"type":30,"tag":151,"props":1515,"children":1516},{"style":225},[1517],{"type":39,"value":971},{"type":30,"tag":151,"props":1519,"children":1521},{"class":153,"line":1520},42,[1522,1526,1530],{"type":30,"tag":151,"props":1523,"children":1524},{"style":225},[1525],{"type":39,"value":980},{"type":30,"tag":151,"props":1527,"children":1528},{"style":497},[1529],{"type":39,"value":447},{"type":30,"tag":151,"props":1531,"children":1532},{"style":225},[1533],{"type":39,"value":545},{"type":30,"tag":151,"props":1535,"children":1537},{"class":153,"line":1536},43,[1538],{"type":30,"tag":151,"props":1539,"children":1540},{"emptyLinePlaceholder":12},[1541],{"type":39,"value":179},{"type":30,"tag":151,"props":1543,"children":1545},{"class":153,"line":1544},44,[1546],{"type":30,"tag":151,"props":1547,"children":1548},{"style":158},[1549],{"type":39,"value":1550},"    // 3. Notification Brevo (12 lignes)\n",{"type":30,"tag":151,"props":1552,"children":1554},{"class":153,"line":1553},45,[1555,1559,1563,1567,1572,1576,1581,1585],{"type":30,"tag":151,"props":1556,"children":1557},{"style":208},[1558],{"type":39,"value":1362},{"type":30,"tag":151,"props":1560,"children":1561},{"style":573},[1562],{"type":39,"value":576},{"type":30,"tag":151,"props":1564,"children":1565},{"style":579},[1566],{"type":39,"value":582},{"type":30,"tag":151,"props":1568,"children":1569},{"style":497},[1570],{"type":39,"value":1571},"brevoService",{"type":30,"tag":151,"props":1573,"children":1574},{"style":579},[1575],{"type":39,"value":582},{"type":30,"tag":151,"props":1577,"children":1578},{"style":192},[1579],{"type":39,"value":1580},"sendTransactionalEmail",{"type":30,"tag":151,"props":1582,"children":1583},{"style":497},[1584],{"type":39,"value":409},{"type":30,"tag":151,"props":1586,"children":1587},{"style":225},[1588],{"type":39,"value":918},{"type":30,"tag":151,"props":1590,"children":1592},{"class":153,"line":1591},46,[1593,1598,1602,1607,1611,1615,1619,1623,1627,1631,1635,1640,1644,1649,1653,1657,1662,1666,1670,1675,1679,1683,1687,1691,1696,1700,1705],{"type":30,"tag":151,"props":1594,"children":1595},{"style":497},[1596],{"type":39,"value":1597},"      to",{"type":30,"tag":151,"props":1599,"children":1600},{"style":579},[1601],{"type":39,"value":268},{"type":30,"tag":151,"props":1603,"children":1604},{"style":497},[1605],{"type":39,"value":1606}," [",{"type":30,"tag":151,"props":1608,"children":1609},{"style":225},[1610],{"type":39,"value":614},{"type":30,"tag":151,"props":1612,"children":1613},{"style":497},[1614],{"type":39,"value":940},{"type":30,"tag":151,"props":1616,"children":1617},{"style":579},[1618],{"type":39,"value":268},{"type":30,"tag":151,"props":1620,"children":1621},{"style":497},[1622],{"type":39,"value":1069},{"type":30,"tag":151,"props":1624,"children":1625},{"style":579},[1626],{"type":39,"value":582},{"type":30,"tag":151,"props":1628,"children":1629},{"style":497},[1630],{"type":39,"value":957},{"type":30,"tag":151,"props":1632,"children":1633},{"style":225},[1634],{"type":39,"value":429},{"type":30,"tag":151,"props":1636,"children":1637},{"style":497},[1638],{"type":39,"value":1639}," name",{"type":30,"tag":151,"props":1641,"children":1642},{"style":579},[1643],{"type":39,"value":268},{"type":30,"tag":151,"props":1645,"children":1646},{"style":533},[1647],{"type":39,"value":1648}," `",{"type":30,"tag":151,"props":1650,"children":1651},{"style":706},[1652],{"type":39,"value":709},{"type":30,"tag":151,"props":1654,"children":1655},{"style":497},[1656],{"type":39,"value":900},{"type":30,"tag":151,"props":1658,"children":1660},{"style":1659},"--shiki-default:#81C8BE;--shiki-dark:#9ECBFF",[1661],{"type":39,"value":582},{"type":30,"tag":151,"props":1663,"children":1664},{"style":497},[1665],{"type":39,"value":1186},{"type":30,"tag":151,"props":1667,"children":1668},{"style":706},[1669],{"type":39,"value":647},{"type":30,"tag":151,"props":1671,"children":1672},{"style":706},[1673],{"type":39,"value":1674}," ${",{"type":30,"tag":151,"props":1676,"children":1677},{"style":497},[1678],{"type":39,"value":900},{"type":30,"tag":151,"props":1680,"children":1681},{"style":1659},[1682],{"type":39,"value":582},{"type":30,"tag":151,"props":1684,"children":1685},{"style":497},[1686],{"type":39,"value":1216},{"type":30,"tag":151,"props":1688,"children":1689},{"style":706},[1690],{"type":39,"value":647},{"type":30,"tag":151,"props":1692,"children":1693},{"style":533},[1694],{"type":39,"value":1695},"`",{"type":30,"tag":151,"props":1697,"children":1698},{"style":225},[1699],{"type":39,"value":652},{"type":30,"tag":151,"props":1701,"children":1702},{"style":497},[1703],{"type":39,"value":1704},"]",{"type":30,"tag":151,"props":1706,"children":1707},{"style":225},[1708],{"type":39,"value":278},{"type":30,"tag":151,"props":1710,"children":1712},{"class":153,"line":1711},47,[1713,1718,1722,1728],{"type":30,"tag":151,"props":1714,"children":1715},{"style":497},[1716],{"type":39,"value":1717},"      templateId",{"type":30,"tag":151,"props":1719,"children":1720},{"style":579},[1721],{"type":39,"value":268},{"type":30,"tag":151,"props":1723,"children":1725},{"style":1724},"--shiki-default:#EF9F76;--shiki-dark:#79B8FF",[1726],{"type":39,"value":1727}," 42",{"type":30,"tag":151,"props":1729,"children":1730},{"style":225},[1731],{"type":39,"value":278},{"type":30,"tag":151,"props":1733,"children":1735},{"class":153,"line":1734},48,[1736,1741,1745,1749,1754,1758,1762,1766,1770,1774,1779,1783,1787,1791,1795],{"type":30,"tag":151,"props":1737,"children":1738},{"style":497},[1739],{"type":39,"value":1740},"      params",{"type":30,"tag":151,"props":1742,"children":1743},{"style":579},[1744],{"type":39,"value":268},{"type":30,"tag":151,"props":1746,"children":1747},{"style":225},[1748],{"type":39,"value":628},{"type":30,"tag":151,"props":1750,"children":1751},{"style":497},[1752],{"type":39,"value":1753}," firstName",{"type":30,"tag":151,"props":1755,"children":1756},{"style":579},[1757],{"type":39,"value":268},{"type":30,"tag":151,"props":1759,"children":1760},{"style":497},[1761],{"type":39,"value":1069},{"type":30,"tag":151,"props":1763,"children":1764},{"style":579},[1765],{"type":39,"value":582},{"type":30,"tag":151,"props":1767,"children":1768},{"style":497},[1769],{"type":39,"value":1186},{"type":30,"tag":151,"props":1771,"children":1772},{"style":225},[1773],{"type":39,"value":429},{"type":30,"tag":151,"props":1775,"children":1776},{"style":497},[1777],{"type":39,"value":1778}," coachName",{"type":30,"tag":151,"props":1780,"children":1781},{"style":579},[1782],{"type":39,"value":268},{"type":30,"tag":151,"props":1784,"children":1785},{"style":497},[1786],{"type":39,"value":560},{"type":30,"tag":151,"props":1788,"children":1789},{"style":579},[1790],{"type":39,"value":582},{"type":30,"tag":151,"props":1792,"children":1793},{"style":497},[1794],{"type":39,"value":752},{"type":30,"tag":151,"props":1796,"children":1797},{"style":225},[1798],{"type":39,"value":971},{"type":30,"tag":151,"props":1800,"children":1802},{"class":153,"line":1801},49,[1803,1807,1811],{"type":30,"tag":151,"props":1804,"children":1805},{"style":225},[1806],{"type":39,"value":980},{"type":30,"tag":151,"props":1808,"children":1809},{"style":497},[1810],{"type":39,"value":447},{"type":30,"tag":151,"props":1812,"children":1813},{"style":225},[1814],{"type":39,"value":545},{"type":30,"tag":151,"props":1816,"children":1818},{"class":153,"line":1817},50,[1819,1823,1827,1831,1835,1839,1844,1849,1853,1857,1861,1866,1870],{"type":30,"tag":151,"props":1820,"children":1821},{"style":208},[1822],{"type":39,"value":1362},{"type":30,"tag":151,"props":1824,"children":1825},{"style":573},[1826],{"type":39,"value":576},{"type":30,"tag":151,"props":1828,"children":1829},{"style":579},[1830],{"type":39,"value":582},{"type":30,"tag":151,"props":1832,"children":1833},{"style":497},[1834],{"type":39,"value":1571},{"type":30,"tag":151,"props":1836,"children":1837},{"style":579},[1838],{"type":39,"value":582},{"type":30,"tag":151,"props":1840,"children":1841},{"style":192},[1842],{"type":39,"value":1843},"addContactToList",{"type":30,"tag":151,"props":1845,"children":1846},{"style":497},[1847],{"type":39,"value":1848},"(client",{"type":30,"tag":151,"props":1850,"children":1851},{"style":579},[1852],{"type":39,"value":582},{"type":30,"tag":151,"props":1854,"children":1855},{"style":497},[1856],{"type":39,"value":957},{"type":30,"tag":151,"props":1858,"children":1859},{"style":225},[1860],{"type":39,"value":429},{"type":30,"tag":151,"props":1862,"children":1863},{"style":533},[1864],{"type":39,"value":1865}," 'clients-actifs'",{"type":30,"tag":151,"props":1867,"children":1868},{"style":497},[1869],{"type":39,"value":447},{"type":30,"tag":151,"props":1871,"children":1872},{"style":225},[1873],{"type":39,"value":545},{"type":30,"tag":151,"props":1875,"children":1877},{"class":153,"line":1876},51,[1878],{"type":30,"tag":151,"props":1879,"children":1880},{"emptyLinePlaceholder":12},[1881],{"type":39,"value":179},{"type":30,"tag":151,"props":1883,"children":1885},{"class":153,"line":1884},52,[1886],{"type":30,"tag":151,"props":1887,"children":1888},{"style":158},[1889],{"type":39,"value":1890},"    // 4. Audit (6 lignes)\n",{"type":30,"tag":151,"props":1892,"children":1894},{"class":153,"line":1893},53,[1895,1899,1903,1907,1912,1916,1921,1925],{"type":30,"tag":151,"props":1896,"children":1897},{"style":208},[1898],{"type":39,"value":1362},{"type":30,"tag":151,"props":1900,"children":1901},{"style":573},[1902],{"type":39,"value":576},{"type":30,"tag":151,"props":1904,"children":1905},{"style":579},[1906],{"type":39,"value":582},{"type":30,"tag":151,"props":1908,"children":1909},{"style":497},[1910],{"type":39,"value":1911},"auditService",{"type":30,"tag":151,"props":1913,"children":1914},{"style":579},[1915],{"type":39,"value":582},{"type":30,"tag":151,"props":1917,"children":1918},{"style":192},[1919],{"type":39,"value":1920},"log",{"type":30,"tag":151,"props":1922,"children":1923},{"style":497},[1924],{"type":39,"value":409},{"type":30,"tag":151,"props":1926,"children":1927},{"style":225},[1928],{"type":39,"value":918},{"type":30,"tag":151,"props":1930,"children":1932},{"class":153,"line":1931},54,[1933,1938,1942,1947],{"type":30,"tag":151,"props":1934,"children":1935},{"style":497},[1936],{"type":39,"value":1937},"      action",{"type":30,"tag":151,"props":1939,"children":1940},{"style":579},[1941],{"type":39,"value":268},{"type":30,"tag":151,"props":1943,"children":1944},{"style":533},[1945],{"type":39,"value":1946}," 'LEAD_CONVERTED'",{"type":30,"tag":151,"props":1948,"children":1949},{"style":225},[1950],{"type":39,"value":278},{"type":30,"tag":151,"props":1952,"children":1954},{"class":153,"line":1953},55,[1955,1960,1964,1969],{"type":30,"tag":151,"props":1956,"children":1957},{"style":497},[1958],{"type":39,"value":1959},"      entityType",{"type":30,"tag":151,"props":1961,"children":1962},{"style":579},[1963],{"type":39,"value":268},{"type":30,"tag":151,"props":1965,"children":1966},{"style":533},[1967],{"type":39,"value":1968}," 'client'",{"type":30,"tag":151,"props":1970,"children":1971},{"style":225},[1972],{"type":39,"value":278},{"type":30,"tag":151,"props":1974,"children":1976},{"class":153,"line":1975},56,[1977,1982,1986,1990,1994,1999],{"type":30,"tag":151,"props":1978,"children":1979},{"style":497},[1980],{"type":39,"value":1981},"      entityId",{"type":30,"tag":151,"props":1983,"children":1984},{"style":579},[1985],{"type":39,"value":268},{"type":30,"tag":151,"props":1987,"children":1988},{"style":497},[1989],{"type":39,"value":1069},{"type":30,"tag":151,"props":1991,"children":1992},{"style":579},[1993],{"type":39,"value":582},{"type":30,"tag":151,"props":1995,"children":1996},{"style":497},[1997],{"type":39,"value":1998},"id",{"type":30,"tag":151,"props":2000,"children":2001},{"style":225},[2002],{"type":39,"value":278},{"type":30,"tag":151,"props":2004,"children":2006},{"class":153,"line":2005},57,[2007,2012,2016,2020],{"type":30,"tag":151,"props":2008,"children":2009},{"style":497},[2010],{"type":39,"value":2011},"      userId",{"type":30,"tag":151,"props":2013,"children":2014},{"style":579},[2015],{"type":39,"value":268},{"type":30,"tag":151,"props":2017,"children":2018},{"style":497},[2019],{"type":39,"value":434},{"type":30,"tag":151,"props":2021,"children":2022},{"style":225},[2023],{"type":39,"value":278},{"type":30,"tag":151,"props":2025,"children":2027},{"class":153,"line":2026},58,[2028,2033,2037,2041,2046,2050,2054],{"type":30,"tag":151,"props":2029,"children":2030},{"style":497},[2031],{"type":39,"value":2032},"      meta",{"type":30,"tag":151,"props":2034,"children":2035},{"style":579},[2036],{"type":39,"value":268},{"type":30,"tag":151,"props":2038,"children":2039},{"style":225},[2040],{"type":39,"value":628},{"type":30,"tag":151,"props":2042,"children":2043},{"style":497},[2044],{"type":39,"value":2045}," fromLeadId",{"type":30,"tag":151,"props":2047,"children":2048},{"style":579},[2049],{"type":39,"value":268},{"type":30,"tag":151,"props":2051,"children":2052},{"style":497},[2053],{"type":39,"value":642},{"type":30,"tag":151,"props":2055,"children":2056},{"style":225},[2057],{"type":39,"value":971},{"type":30,"tag":151,"props":2059,"children":2061},{"class":153,"line":2060},59,[2062,2066,2070],{"type":30,"tag":151,"props":2063,"children":2064},{"style":225},[2065],{"type":39,"value":980},{"type":30,"tag":151,"props":2067,"children":2068},{"style":497},[2069],{"type":39,"value":447},{"type":30,"tag":151,"props":2071,"children":2072},{"style":225},[2073],{"type":39,"value":545},{"type":30,"tag":151,"props":2075,"children":2077},{"class":153,"line":2076},60,[2078],{"type":30,"tag":151,"props":2079,"children":2080},{"emptyLinePlaceholder":12},[2081],{"type":39,"value":179},{"type":30,"tag":151,"props":2083,"children":2085},{"class":153,"line":2084},61,[2086],{"type":30,"tag":151,"props":2087,"children":2088},{"style":158},[2089],{"type":39,"value":2090},"    // 5. Événement domaine (4 lignes)\n",{"type":30,"tag":151,"props":2092,"children":2094},{"class":153,"line":2093},62,[2095,2100,2104,2109,2113,2118,2122,2127,2131,2135,2140,2144,2148,2152,2156,2160,2164,2168,2172],{"type":30,"tag":151,"props":2096,"children":2097},{"style":573},[2098],{"type":39,"value":2099},"    this",{"type":30,"tag":151,"props":2101,"children":2102},{"style":579},[2103],{"type":39,"value":582},{"type":30,"tag":151,"props":2105,"children":2106},{"style":497},[2107],{"type":39,"value":2108},"eventEmitter",{"type":30,"tag":151,"props":2110,"children":2111},{"style":579},[2112],{"type":39,"value":582},{"type":30,"tag":151,"props":2114,"children":2115},{"style":192},[2116],{"type":39,"value":2117},"emit",{"type":30,"tag":151,"props":2119,"children":2120},{"style":497},[2121],{"type":39,"value":409},{"type":30,"tag":151,"props":2123,"children":2124},{"style":533},[2125],{"type":39,"value":2126},"'client.created'",{"type":30,"tag":151,"props":2128,"children":2129},{"style":225},[2130],{"type":39,"value":429},{"type":30,"tag":151,"props":2132,"children":2133},{"style":225},[2134],{"type":39,"value":628},{"type":30,"tag":151,"props":2136,"children":2137},{"style":497},[2138],{"type":39,"value":2139}," clientId",{"type":30,"tag":151,"props":2141,"children":2142},{"style":579},[2143],{"type":39,"value":268},{"type":30,"tag":151,"props":2145,"children":2146},{"style":497},[2147],{"type":39,"value":1069},{"type":30,"tag":151,"props":2149,"children":2150},{"style":579},[2151],{"type":39,"value":582},{"type":30,"tag":151,"props":2153,"children":2154},{"style":497},[2155],{"type":39,"value":1998},{"type":30,"tag":151,"props":2157,"children":2158},{"style":225},[2159],{"type":39,"value":429},{"type":30,"tag":151,"props":2161,"children":2162},{"style":497},[2163],{"type":39,"value":966},{"type":30,"tag":151,"props":2165,"children":2166},{"style":225},[2167],{"type":39,"value":647},{"type":30,"tag":151,"props":2169,"children":2170},{"style":497},[2171],{"type":39,"value":447},{"type":30,"tag":151,"props":2173,"children":2174},{"style":225},[2175],{"type":39,"value":545},{"type":30,"tag":151,"props":2177,"children":2178},{"class":153,"line":10},[2179],{"type":30,"tag":151,"props":2180,"children":2181},{"emptyLinePlaceholder":12},[2182],{"type":39,"value":179},{"type":30,"tag":151,"props":2184,"children":2186},{"class":153,"line":2185},64,[2187,2192,2197,2201,2206,2211],{"type":30,"tag":151,"props":2188,"children":2189},{"style":208},[2190],{"type":39,"value":2191},"    return",{"type":30,"tag":151,"props":2193,"children":2194},{"style":497},[2195],{"type":39,"value":2196}," ClientDto",{"type":30,"tag":151,"props":2198,"children":2199},{"style":579},[2200],{"type":39,"value":582},{"type":30,"tag":151,"props":2202,"children":2203},{"style":192},[2204],{"type":39,"value":2205},"fromPrisma",{"type":30,"tag":151,"props":2207,"children":2208},{"style":497},[2209],{"type":39,"value":2210},"(client)",{"type":30,"tag":151,"props":2212,"children":2213},{"style":225},[2214],{"type":39,"value":545},{"type":30,"tag":151,"props":2216,"children":2218},{"class":153,"line":2217},65,[2219],{"type":30,"tag":151,"props":2220,"children":2221},{"style":225},[2222],{"type":39,"value":2223},"  }\n",{"type":30,"tag":151,"props":2225,"children":2227},{"class":153,"line":2226},66,[2228],{"type":30,"tag":151,"props":2229,"children":2230},{"style":225},[2231],{"type":39,"value":2232},"}\n",{"type":30,"tag":31,"props":2234,"children":2235},{},[2236,2238,2244,2246,2252,2253,2259,2260,2266,2267,2273,2274,2280],{"type":39,"value":2237},"Le contre-pattern craft, c'est l'application du Single Responsibility Principle. Cette fonction devient un orchestrateur de 10 lignes qui appelle des helpers nommés : ",{"type":30,"tag":147,"props":2239,"children":2241},{"className":2240},[],[2242],{"type":39,"value":2243},"assertLeadIsConvertible",{"type":39,"value":2245},", ",{"type":30,"tag":147,"props":2247,"children":2249},{"className":2248},[],[2250],{"type":39,"value":2251},"createClientFromLead",{"type":39,"value":2245},{"type":30,"tag":147,"props":2254,"children":2256},{"className":2255},[],[2257],{"type":39,"value":2258},"markLeadAsConverted",{"type":39,"value":2245},{"type":30,"tag":147,"props":2261,"children":2263},{"className":2262},[],[2264],{"type":39,"value":2265},"notifyClientOnboarding",{"type":39,"value":2245},{"type":30,"tag":147,"props":2268,"children":2270},{"className":2269},[],[2271],{"type":39,"value":2272},"logConversionAudit",{"type":39,"value":2245},{"type":30,"tag":147,"props":2275,"children":2277},{"className":2276},[],[2278],{"type":39,"value":2279},"emitClientCreated",{"type":39,"value":2281},". Chacun est testable isolément. Chacun est lisible en 30 secondes.",{"type":30,"tag":31,"props":2283,"children":2284},{},[2285,2287,2292],{"type":39,"value":2286},"Le prompt que j'utilise : ",{"type":30,"tag":98,"props":2288,"children":2289},{},[2290],{"type":39,"value":2291},"\"Découpe ce use case en responsabilités nommées. Chaque helper doit tenir en moins de 20 lignes et avoir un seul motif de changement.\"",{"type":39,"value":2293}," Claude exécute proprement. Le problème est qu'il ne le fait jamais spontanément.",{"type":30,"tag":47,"props":2295,"children":2296},{},[],{"type":30,"tag":51,"props":2298,"children":2300},{"id":2299},"pattern-2-couplage-métierorm",[2301],{"type":39,"value":2302},"Pattern #2 : couplage métier/ORM",{"type":30,"tag":31,"props":2304,"children":2305},{},[2306,2308,2314],{"type":39,"value":2307},"Celui-là est plus insidieux. Claude injecte directement le ",{"type":30,"tag":147,"props":2309,"children":2311},{"className":2310},[],[2312],{"type":39,"value":2313},"PrismaClient",{"type":39,"value":2315}," dans les use cases métier. Le résultat : vos règles de gestion ne peuvent plus tourner sans une base Postgres, vos tests ne peuvent plus être unitaires, et changer de stratégie de persistence devient une refonte de plusieurs mois.",{"type":30,"tag":31,"props":2317,"children":2318},{},[2319,2321,2327],{"type":39,"value":2320},"Concrètement, j'ai vu ça dans crmcoaching sur le bounded context ",{"type":30,"tag":147,"props":2322,"children":2324},{"className":2323},[],[2325],{"type":39,"value":2326},"slot-hold",{"type":39,"value":2328}," :",{"type":30,"tag":140,"props":2330,"children":2332},{"className":142,"code":2331,"language":144,"meta":7,"style":7},"// apps/api/src/application/use-cases/check-slot-availability.use-case.ts\n// Couplage direct Prisma dans le use case (anti-pattern)\n\n@Injectable()\nexport class CheckSlotAvailabilityUseCase {\n  constructor(\n    private readonly prisma: PrismaClient, // couplage direct infra\n  ) {}\n\n  async execute(slotId: string, coachId: string): Promise\u003Cboolean> {\n    const holds = await this.prisma.slotHold.count({\n      where: { slotId, status: 'ACTIVE', expiresAt: { gt: new Date() } },\n    });\n    const slot = await this.prisma.slot.findUnique({ where: { id: slotId } });\n    return slot != null && slot.coachId === coachId && holds === 0;\n  }\n}\n",[2333],{"type":30,"tag":147,"props":2334,"children":2335},{"__ignoreMap":7},[2336,2344,2352,2359,2374,2394,2405,2437,2448,2455,2528,2586,2670,2685,2783,2853,2860],{"type":30,"tag":151,"props":2337,"children":2338},{"class":153,"line":154},[2339],{"type":30,"tag":151,"props":2340,"children":2341},{"style":158},[2342],{"type":39,"value":2343},"// apps/api/src/application/use-cases/check-slot-availability.use-case.ts\n",{"type":30,"tag":151,"props":2345,"children":2346},{"class":153,"line":164},[2347],{"type":30,"tag":151,"props":2348,"children":2349},{"style":158},[2350],{"type":39,"value":2351},"// Couplage direct Prisma dans le use case (anti-pattern)\n",{"type":30,"tag":151,"props":2353,"children":2354},{"class":153,"line":173},[2355],{"type":30,"tag":151,"props":2356,"children":2357},{"emptyLinePlaceholder":12},[2358],{"type":39,"value":179},{"type":30,"tag":151,"props":2360,"children":2361},{"class":153,"line":182},[2362,2366,2370],{"type":30,"tag":151,"props":2363,"children":2364},{"style":186},[2365],{"type":39,"value":189},{"type":30,"tag":151,"props":2367,"children":2368},{"style":192},[2369],{"type":39,"value":195},{"type":30,"tag":151,"props":2371,"children":2372},{"style":198},[2373],{"type":39,"value":201},{"type":30,"tag":151,"props":2375,"children":2376},{"class":153,"line":204},[2377,2381,2385,2390],{"type":30,"tag":151,"props":2378,"children":2379},{"style":208},[2380],{"type":39,"value":211},{"type":30,"tag":151,"props":2382,"children":2383},{"style":208},[2384],{"type":39,"value":216},{"type":30,"tag":151,"props":2386,"children":2387},{"style":219},[2388],{"type":39,"value":2389}," CheckSlotAvailabilityUseCase",{"type":30,"tag":151,"props":2391,"children":2392},{"style":225},[2393],{"type":39,"value":228},{"type":30,"tag":151,"props":2395,"children":2396},{"class":153,"line":231},[2397,2401],{"type":30,"tag":151,"props":2398,"children":2399},{"style":208},[2400],{"type":39,"value":237},{"type":30,"tag":151,"props":2402,"children":2403},{"style":225},[2404],{"type":39,"value":242},{"type":30,"tag":151,"props":2406,"children":2407},{"class":153,"line":245},[2408,2412,2416,2420,2424,2428,2432],{"type":30,"tag":151,"props":2409,"children":2410},{"style":208},[2411],{"type":39,"value":251},{"type":30,"tag":151,"props":2413,"children":2414},{"style":208},[2415],{"type":39,"value":256},{"type":30,"tag":151,"props":2417,"children":2418},{"style":259},[2419],{"type":39,"value":262},{"type":30,"tag":151,"props":2421,"children":2422},{"style":265},[2423],{"type":39,"value":268},{"type":30,"tag":151,"props":2425,"children":2426},{"style":219},[2427],{"type":39,"value":273},{"type":30,"tag":151,"props":2429,"children":2430},{"style":225},[2431],{"type":39,"value":429},{"type":30,"tag":151,"props":2433,"children":2434},{"style":158},[2435],{"type":39,"value":2436}," // couplage direct infra\n",{"type":30,"tag":151,"props":2438,"children":2439},{"class":153,"line":281},[2440,2444],{"type":30,"tag":151,"props":2441,"children":2442},{"style":225},[2443],{"type":39,"value":377},{"type":30,"tag":151,"props":2445,"children":2446},{"style":225},[2447],{"type":39,"value":382},{"type":30,"tag":151,"props":2449,"children":2450},{"class":153,"line":311},[2451],{"type":30,"tag":151,"props":2452,"children":2453},{"emptyLinePlaceholder":12},[2454],{"type":39,"value":179},{"type":30,"tag":151,"props":2456,"children":2457},{"class":153,"line":341},[2458,2462,2466,2470,2475,2479,2483,2487,2491,2495,2499,2503,2507,2511,2515,2520,2524],{"type":30,"tag":151,"props":2459,"children":2460},{"style":208},[2461],{"type":39,"value":399},{"type":30,"tag":151,"props":2463,"children":2464},{"style":192},[2465],{"type":39,"value":404},{"type":30,"tag":151,"props":2467,"children":2468},{"style":225},[2469],{"type":39,"value":409},{"type":30,"tag":151,"props":2471,"children":2472},{"style":259},[2473],{"type":39,"value":2474},"slotId",{"type":30,"tag":151,"props":2476,"children":2477},{"style":265},[2478],{"type":39,"value":268},{"type":30,"tag":151,"props":2480,"children":2481},{"style":421},[2482],{"type":39,"value":424},{"type":30,"tag":151,"props":2484,"children":2485},{"style":225},[2486],{"type":39,"value":429},{"type":30,"tag":151,"props":2488,"children":2489},{"style":259},[2490],{"type":39,"value":434},{"type":30,"tag":151,"props":2492,"children":2493},{"style":265},[2494],{"type":39,"value":268},{"type":30,"tag":151,"props":2496,"children":2497},{"style":421},[2498],{"type":39,"value":424},{"type":30,"tag":151,"props":2500,"children":2501},{"style":225},[2502],{"type":39,"value":447},{"type":30,"tag":151,"props":2504,"children":2505},{"style":265},[2506],{"type":39,"value":268},{"type":30,"tag":151,"props":2508,"children":2509},{"style":219},[2510],{"type":39,"value":456},{"type":30,"tag":151,"props":2512,"children":2513},{"style":459},[2514],{"type":39,"value":462},{"type":30,"tag":151,"props":2516,"children":2517},{"style":421},[2518],{"type":39,"value":2519},"boolean",{"type":30,"tag":151,"props":2521,"children":2522},{"style":459},[2523],{"type":39,"value":472},{"type":30,"tag":151,"props":2525,"children":2526},{"style":225},[2527],{"type":39,"value":228},{"type":30,"tag":151,"props":2529,"children":2530},{"class":153,"line":371},[2531,2535,2540,2544,2548,2552,2556,2560,2564,2569,2573,2578,2582],{"type":30,"tag":151,"props":2532,"children":2533},{"style":208},[2534],{"type":39,"value":554},{"type":30,"tag":151,"props":2536,"children":2537},{"style":557},[2538],{"type":39,"value":2539}," holds",{"type":30,"tag":151,"props":2541,"children":2542},{"style":265},[2543],{"type":39,"value":565},{"type":30,"tag":151,"props":2545,"children":2546},{"style":208},[2547],{"type":39,"value":570},{"type":30,"tag":151,"props":2549,"children":2550},{"style":573},[2551],{"type":39,"value":576},{"type":30,"tag":151,"props":2553,"children":2554},{"style":579},[2555],{"type":39,"value":582},{"type":30,"tag":151,"props":2557,"children":2558},{"style":497},[2559],{"type":39,"value":587},{"type":30,"tag":151,"props":2561,"children":2562},{"style":579},[2563],{"type":39,"value":582},{"type":30,"tag":151,"props":2565,"children":2566},{"style":497},[2567],{"type":39,"value":2568},"slotHold",{"type":30,"tag":151,"props":2570,"children":2571},{"style":579},[2572],{"type":39,"value":582},{"type":30,"tag":151,"props":2574,"children":2575},{"style":192},[2576],{"type":39,"value":2577},"count",{"type":30,"tag":151,"props":2579,"children":2580},{"style":497},[2581],{"type":39,"value":409},{"type":30,"tag":151,"props":2583,"children":2584},{"style":225},[2585],{"type":39,"value":918},{"type":30,"tag":151,"props":2587,"children":2588},{"class":153,"line":385},[2589,2593,2597,2601,2606,2610,2614,2618,2622,2626,2631,2635,2639,2644,2648,2652,2656,2661,2665],{"type":30,"tag":151,"props":2590,"children":2591},{"style":497},[2592],{"type":39,"value":927},{"type":30,"tag":151,"props":2594,"children":2595},{"style":579},[2596],{"type":39,"value":268},{"type":30,"tag":151,"props":2598,"children":2599},{"style":225},[2600],{"type":39,"value":628},{"type":30,"tag":151,"props":2602,"children":2603},{"style":497},[2604],{"type":39,"value":2605}," slotId",{"type":30,"tag":151,"props":2607,"children":2608},{"style":225},[2609],{"type":39,"value":429},{"type":30,"tag":151,"props":2611,"children":2612},{"style":497},[2613],{"type":39,"value":1452},{"type":30,"tag":151,"props":2615,"children":2616},{"style":579},[2617],{"type":39,"value":268},{"type":30,"tag":151,"props":2619,"children":2620},{"style":533},[2621],{"type":39,"value":1281},{"type":30,"tag":151,"props":2623,"children":2624},{"style":225},[2625],{"type":39,"value":429},{"type":30,"tag":151,"props":2627,"children":2628},{"style":497},[2629],{"type":39,"value":2630}," expiresAt",{"type":30,"tag":151,"props":2632,"children":2633},{"style":579},[2634],{"type":39,"value":268},{"type":30,"tag":151,"props":2636,"children":2637},{"style":225},[2638],{"type":39,"value":628},{"type":30,"tag":151,"props":2640,"children":2641},{"style":497},[2642],{"type":39,"value":2643}," gt",{"type":30,"tag":151,"props":2645,"children":2646},{"style":579},[2647],{"type":39,"value":268},{"type":30,"tag":151,"props":2649,"children":2650},{"style":518},[2651],{"type":39,"value":521},{"type":30,"tag":151,"props":2653,"children":2654},{"style":192},[2655],{"type":39,"value":1482},{"type":30,"tag":151,"props":2657,"children":2658},{"style":497},[2659],{"type":39,"value":2660},"() ",{"type":30,"tag":151,"props":2662,"children":2663},{"style":225},[2664],{"type":39,"value":647},{"type":30,"tag":151,"props":2666,"children":2667},{"style":225},[2668],{"type":39,"value":2669}," },\n",{"type":30,"tag":151,"props":2671,"children":2672},{"class":153,"line":393},[2673,2677,2681],{"type":30,"tag":151,"props":2674,"children":2675},{"style":225},[2676],{"type":39,"value":980},{"type":30,"tag":151,"props":2678,"children":2679},{"style":497},[2680],{"type":39,"value":447},{"type":30,"tag":151,"props":2682,"children":2683},{"style":225},[2684],{"type":39,"value":545},{"type":30,"tag":151,"props":2686,"children":2687},{"class":153,"line":479},[2688,2692,2697,2701,2705,2709,2713,2717,2721,2726,2730,2734,2738,2742,2746,2750,2754,2758,2762,2767,2771,2775,2779],{"type":30,"tag":151,"props":2689,"children":2690},{"style":208},[2691],{"type":39,"value":554},{"type":30,"tag":151,"props":2693,"children":2694},{"style":557},[2695],{"type":39,"value":2696}," slot",{"type":30,"tag":151,"props":2698,"children":2699},{"style":265},[2700],{"type":39,"value":565},{"type":30,"tag":151,"props":2702,"children":2703},{"style":208},[2704],{"type":39,"value":570},{"type":30,"tag":151,"props":2706,"children":2707},{"style":573},[2708],{"type":39,"value":576},{"type":30,"tag":151,"props":2710,"children":2711},{"style":579},[2712],{"type":39,"value":582},{"type":30,"tag":151,"props":2714,"children":2715},{"style":497},[2716],{"type":39,"value":587},{"type":30,"tag":151,"props":2718,"children":2719},{"style":579},[2720],{"type":39,"value":582},{"type":30,"tag":151,"props":2722,"children":2723},{"style":497},[2724],{"type":39,"value":2725},"slot",{"type":30,"tag":151,"props":2727,"children":2728},{"style":579},[2729],{"type":39,"value":582},{"type":30,"tag":151,"props":2731,"children":2732},{"style":192},[2733],{"type":39,"value":605},{"type":30,"tag":151,"props":2735,"children":2736},{"style":497},[2737],{"type":39,"value":409},{"type":30,"tag":151,"props":2739,"children":2740},{"style":225},[2741],{"type":39,"value":614},{"type":30,"tag":151,"props":2743,"children":2744},{"style":497},[2745],{"type":39,"value":619},{"type":30,"tag":151,"props":2747,"children":2748},{"style":579},[2749],{"type":39,"value":268},{"type":30,"tag":151,"props":2751,"children":2752},{"style":225},[2753],{"type":39,"value":628},{"type":30,"tag":151,"props":2755,"children":2756},{"style":497},[2757],{"type":39,"value":633},{"type":30,"tag":151,"props":2759,"children":2760},{"style":579},[2761],{"type":39,"value":268},{"type":30,"tag":151,"props":2763,"children":2764},{"style":497},[2765],{"type":39,"value":2766}," slotId ",{"type":30,"tag":151,"props":2768,"children":2769},{"style":225},[2770],{"type":39,"value":647},{"type":30,"tag":151,"props":2772,"children":2773},{"style":225},[2774],{"type":39,"value":652},{"type":30,"tag":151,"props":2776,"children":2777},{"style":497},[2778],{"type":39,"value":447},{"type":30,"tag":151,"props":2780,"children":2781},{"style":225},[2782],{"type":39,"value":545},{"type":30,"tag":151,"props":2784,"children":2785},{"class":153,"line":488},[2786,2790,2795,2800,2805,2810,2814,2818,2822,2826,2830,2835,2840,2844,2849],{"type":30,"tag":151,"props":2787,"children":2788},{"style":208},[2789],{"type":39,"value":2191},{"type":30,"tag":151,"props":2791,"children":2792},{"style":497},[2793],{"type":39,"value":2794}," slot ",{"type":30,"tag":151,"props":2796,"children":2797},{"style":265},[2798],{"type":39,"value":2799},"!=",{"type":30,"tag":151,"props":2801,"children":2802},{"style":421},[2803],{"type":39,"value":2804}," null",{"type":30,"tag":151,"props":2806,"children":2807},{"style":265},[2808],{"type":39,"value":2809}," &&",{"type":30,"tag":151,"props":2811,"children":2812},{"style":497},[2813],{"type":39,"value":2696},{"type":30,"tag":151,"props":2815,"children":2816},{"style":579},[2817],{"type":39,"value":582},{"type":30,"tag":151,"props":2819,"children":2820},{"style":497},[2821],{"type":39,"value":752},{"type":30,"tag":151,"props":2823,"children":2824},{"style":265},[2825],{"type":39,"value":818},{"type":30,"tag":151,"props":2827,"children":2828},{"style":497},[2829],{"type":39,"value":966},{"type":30,"tag":151,"props":2831,"children":2832},{"style":265},[2833],{"type":39,"value":2834},"&&",{"type":30,"tag":151,"props":2836,"children":2837},{"style":497},[2838],{"type":39,"value":2839}," holds ",{"type":30,"tag":151,"props":2841,"children":2842},{"style":265},[2843],{"type":39,"value":818},{"type":30,"tag":151,"props":2845,"children":2846},{"style":1724},[2847],{"type":39,"value":2848}," 0",{"type":30,"tag":151,"props":2850,"children":2851},{"style":225},[2852],{"type":39,"value":545},{"type":30,"tag":151,"props":2854,"children":2855},{"class":153,"line":548},[2856],{"type":30,"tag":151,"props":2857,"children":2858},{"style":225},[2859],{"type":39,"value":2223},{"type":30,"tag":151,"props":2861,"children":2862},{"class":153,"line":663},[2863],{"type":30,"tag":151,"props":2864,"children":2865},{"style":225},[2866],{"type":39,"value":2232},{"type":30,"tag":31,"props":2868,"children":2869},{},[2870,2872,2878,2880,2886,2888,2894,2896,2902,2903,2909,2911,2917],{"type":39,"value":2871},"Le contre-pattern, c'est l'",{"type":30,"tag":63,"props":2873,"children":2875},{"href":2874},"/fr/architecture-craft/architecture-hexagonale-java-exemples-bonnes-pratiques",[2876],{"type":39,"value":2877},"architecture hexagonale d'Alistair Cockburn",{"type":39,"value":2879}," (2005). La règle métier ne connaît pas Prisma. Elle prend un port ",{"type":30,"tag":147,"props":2881,"children":2883},{"className":2882},[],[2884],{"type":39,"value":2885},"ISlotHoldRepository",{"type":39,"value":2887}," qui expose ",{"type":30,"tag":147,"props":2889,"children":2891},{"className":2890},[],[2892],{"type":39,"value":2893},"countActiveHolds(slotId)",{"type":39,"value":2895}," et un port ",{"type":30,"tag":147,"props":2897,"children":2899},{"className":2898},[],[2900],{"type":39,"value":2901},"ISlotRepository",{"type":39,"value":2887},{"type":30,"tag":147,"props":2904,"children":2906},{"className":2905},[],[2907],{"type":39,"value":2908},"findById(slotId)",{"type":39,"value":2910},". L'implémentation Prisma vit dans ",{"type":30,"tag":147,"props":2912,"children":2914},{"className":2913},[],[2915],{"type":39,"value":2916},"infrastructure/",{"type":39,"value":2918},". Les tests unitaires utilisent un fake repository en mémoire.",{"type":30,"tag":140,"props":2920,"children":2922},{"className":142,"code":2921,"language":144,"meta":7,"style":7},"// apps/api/src/domain/ports/slot-hold.repository.port.ts\nexport interface ISlotHoldRepository {\n  countActiveHolds(slotId: string): Promise\u003Cnumber>;\n}\n\n// apps/api/src/application/use-cases/check-slot-availability.use-case.ts\n@Injectable()\nexport class CheckSlotAvailabilityUseCase {\n  constructor(\n    private readonly slotRepo: ISlotRepository,\n    private readonly slotHoldRepo: ISlotHoldRepository,\n  ) {}\n\n  async execute(slotId: string, coachId: string): Promise\u003Cboolean> {\n    const slot = await this.slotRepo.findById(slotId);\n    if (slot == null || slot.coachId !== coachId) return false;\n    const activeHolds = await this.slotHoldRepo.countActiveHolds(slotId);\n    return activeHolds === 0;\n  }\n}\n",[2923],{"type":30,"tag":147,"props":2924,"children":2925},{"__ignoreMap":7},[2926,2934,2955,3008,3015,3022,3029,3044,3063,3074,3103,3131,3142,3149,3220,3270,3330,3380,3404,3411],{"type":30,"tag":151,"props":2927,"children":2928},{"class":153,"line":154},[2929],{"type":30,"tag":151,"props":2930,"children":2931},{"style":158},[2932],{"type":39,"value":2933},"// apps/api/src/domain/ports/slot-hold.repository.port.ts\n",{"type":30,"tag":151,"props":2935,"children":2936},{"class":153,"line":164},[2937,2941,2946,2951],{"type":30,"tag":151,"props":2938,"children":2939},{"style":208},[2940],{"type":39,"value":211},{"type":30,"tag":151,"props":2942,"children":2943},{"style":208},[2944],{"type":39,"value":2945}," interface",{"type":30,"tag":151,"props":2947,"children":2948},{"style":219},[2949],{"type":39,"value":2950}," ISlotHoldRepository",{"type":30,"tag":151,"props":2952,"children":2953},{"style":225},[2954],{"type":39,"value":228},{"type":30,"tag":151,"props":2956,"children":2957},{"class":153,"line":173},[2958,2963,2967,2971,2975,2979,2983,2987,2991,2995,3000,3004],{"type":30,"tag":151,"props":2959,"children":2960},{"style":192},[2961],{"type":39,"value":2962},"  countActiveHolds",{"type":30,"tag":151,"props":2964,"children":2965},{"style":225},[2966],{"type":39,"value":409},{"type":30,"tag":151,"props":2968,"children":2969},{"style":259},[2970],{"type":39,"value":2474},{"type":30,"tag":151,"props":2972,"children":2973},{"style":265},[2974],{"type":39,"value":268},{"type":30,"tag":151,"props":2976,"children":2977},{"style":421},[2978],{"type":39,"value":424},{"type":30,"tag":151,"props":2980,"children":2981},{"style":225},[2982],{"type":39,"value":447},{"type":30,"tag":151,"props":2984,"children":2985},{"style":265},[2986],{"type":39,"value":268},{"type":30,"tag":151,"props":2988,"children":2989},{"style":219},[2990],{"type":39,"value":456},{"type":30,"tag":151,"props":2992,"children":2993},{"style":459},[2994],{"type":39,"value":462},{"type":30,"tag":151,"props":2996,"children":2997},{"style":421},[2998],{"type":39,"value":2999},"number",{"type":30,"tag":151,"props":3001,"children":3002},{"style":459},[3003],{"type":39,"value":472},{"type":30,"tag":151,"props":3005,"children":3006},{"style":225},[3007],{"type":39,"value":545},{"type":30,"tag":151,"props":3009,"children":3010},{"class":153,"line":182},[3011],{"type":30,"tag":151,"props":3012,"children":3013},{"style":225},[3014],{"type":39,"value":2232},{"type":30,"tag":151,"props":3016,"children":3017},{"class":153,"line":204},[3018],{"type":30,"tag":151,"props":3019,"children":3020},{"emptyLinePlaceholder":12},[3021],{"type":39,"value":179},{"type":30,"tag":151,"props":3023,"children":3024},{"class":153,"line":231},[3025],{"type":30,"tag":151,"props":3026,"children":3027},{"style":158},[3028],{"type":39,"value":2343},{"type":30,"tag":151,"props":3030,"children":3031},{"class":153,"line":245},[3032,3036,3040],{"type":30,"tag":151,"props":3033,"children":3034},{"style":186},[3035],{"type":39,"value":189},{"type":30,"tag":151,"props":3037,"children":3038},{"style":192},[3039],{"type":39,"value":195},{"type":30,"tag":151,"props":3041,"children":3042},{"style":198},[3043],{"type":39,"value":201},{"type":30,"tag":151,"props":3045,"children":3046},{"class":153,"line":281},[3047,3051,3055,3059],{"type":30,"tag":151,"props":3048,"children":3049},{"style":208},[3050],{"type":39,"value":211},{"type":30,"tag":151,"props":3052,"children":3053},{"style":208},[3054],{"type":39,"value":216},{"type":30,"tag":151,"props":3056,"children":3057},{"style":219},[3058],{"type":39,"value":2389},{"type":30,"tag":151,"props":3060,"children":3061},{"style":225},[3062],{"type":39,"value":228},{"type":30,"tag":151,"props":3064,"children":3065},{"class":153,"line":311},[3066,3070],{"type":30,"tag":151,"props":3067,"children":3068},{"style":208},[3069],{"type":39,"value":237},{"type":30,"tag":151,"props":3071,"children":3072},{"style":225},[3073],{"type":39,"value":242},{"type":30,"tag":151,"props":3075,"children":3076},{"class":153,"line":341},[3077,3081,3085,3090,3094,3099],{"type":30,"tag":151,"props":3078,"children":3079},{"style":208},[3080],{"type":39,"value":251},{"type":30,"tag":151,"props":3082,"children":3083},{"style":208},[3084],{"type":39,"value":256},{"type":30,"tag":151,"props":3086,"children":3087},{"style":259},[3088],{"type":39,"value":3089}," slotRepo",{"type":30,"tag":151,"props":3091,"children":3092},{"style":265},[3093],{"type":39,"value":268},{"type":30,"tag":151,"props":3095,"children":3096},{"style":219},[3097],{"type":39,"value":3098}," ISlotRepository",{"type":30,"tag":151,"props":3100,"children":3101},{"style":225},[3102],{"type":39,"value":278},{"type":30,"tag":151,"props":3104,"children":3105},{"class":153,"line":371},[3106,3110,3114,3119,3123,3127],{"type":30,"tag":151,"props":3107,"children":3108},{"style":208},[3109],{"type":39,"value":251},{"type":30,"tag":151,"props":3111,"children":3112},{"style":208},[3113],{"type":39,"value":256},{"type":30,"tag":151,"props":3115,"children":3116},{"style":259},[3117],{"type":39,"value":3118}," slotHoldRepo",{"type":30,"tag":151,"props":3120,"children":3121},{"style":265},[3122],{"type":39,"value":268},{"type":30,"tag":151,"props":3124,"children":3125},{"style":219},[3126],{"type":39,"value":2950},{"type":30,"tag":151,"props":3128,"children":3129},{"style":225},[3130],{"type":39,"value":278},{"type":30,"tag":151,"props":3132,"children":3133},{"class":153,"line":385},[3134,3138],{"type":30,"tag":151,"props":3135,"children":3136},{"style":225},[3137],{"type":39,"value":377},{"type":30,"tag":151,"props":3139,"children":3140},{"style":225},[3141],{"type":39,"value":382},{"type":30,"tag":151,"props":3143,"children":3144},{"class":153,"line":393},[3145],{"type":30,"tag":151,"props":3146,"children":3147},{"emptyLinePlaceholder":12},[3148],{"type":39,"value":179},{"type":30,"tag":151,"props":3150,"children":3151},{"class":153,"line":479},[3152,3156,3160,3164,3168,3172,3176,3180,3184,3188,3192,3196,3200,3204,3208,3212,3216],{"type":30,"tag":151,"props":3153,"children":3154},{"style":208},[3155],{"type":39,"value":399},{"type":30,"tag":151,"props":3157,"children":3158},{"style":192},[3159],{"type":39,"value":404},{"type":30,"tag":151,"props":3161,"children":3162},{"style":225},[3163],{"type":39,"value":409},{"type":30,"tag":151,"props":3165,"children":3166},{"style":259},[3167],{"type":39,"value":2474},{"type":30,"tag":151,"props":3169,"children":3170},{"style":265},[3171],{"type":39,"value":268},{"type":30,"tag":151,"props":3173,"children":3174},{"style":421},[3175],{"type":39,"value":424},{"type":30,"tag":151,"props":3177,"children":3178},{"style":225},[3179],{"type":39,"value":429},{"type":30,"tag":151,"props":3181,"children":3182},{"style":259},[3183],{"type":39,"value":434},{"type":30,"tag":151,"props":3185,"children":3186},{"style":265},[3187],{"type":39,"value":268},{"type":30,"tag":151,"props":3189,"children":3190},{"style":421},[3191],{"type":39,"value":424},{"type":30,"tag":151,"props":3193,"children":3194},{"style":225},[3195],{"type":39,"value":447},{"type":30,"tag":151,"props":3197,"children":3198},{"style":265},[3199],{"type":39,"value":268},{"type":30,"tag":151,"props":3201,"children":3202},{"style":219},[3203],{"type":39,"value":456},{"type":30,"tag":151,"props":3205,"children":3206},{"style":459},[3207],{"type":39,"value":462},{"type":30,"tag":151,"props":3209,"children":3210},{"style":421},[3211],{"type":39,"value":2519},{"type":30,"tag":151,"props":3213,"children":3214},{"style":459},[3215],{"type":39,"value":472},{"type":30,"tag":151,"props":3217,"children":3218},{"style":225},[3219],{"type":39,"value":228},{"type":30,"tag":151,"props":3221,"children":3222},{"class":153,"line":488},[3223,3227,3231,3235,3239,3243,3247,3252,3256,3261,3266],{"type":30,"tag":151,"props":3224,"children":3225},{"style":208},[3226],{"type":39,"value":554},{"type":30,"tag":151,"props":3228,"children":3229},{"style":557},[3230],{"type":39,"value":2696},{"type":30,"tag":151,"props":3232,"children":3233},{"style":265},[3234],{"type":39,"value":565},{"type":30,"tag":151,"props":3236,"children":3237},{"style":208},[3238],{"type":39,"value":570},{"type":30,"tag":151,"props":3240,"children":3241},{"style":573},[3242],{"type":39,"value":576},{"type":30,"tag":151,"props":3244,"children":3245},{"style":579},[3246],{"type":39,"value":582},{"type":30,"tag":151,"props":3248,"children":3249},{"style":497},[3250],{"type":39,"value":3251},"slotRepo",{"type":30,"tag":151,"props":3253,"children":3254},{"style":579},[3255],{"type":39,"value":582},{"type":30,"tag":151,"props":3257,"children":3258},{"style":192},[3259],{"type":39,"value":3260},"findById",{"type":30,"tag":151,"props":3262,"children":3263},{"style":497},[3264],{"type":39,"value":3265},"(slotId)",{"type":30,"tag":151,"props":3267,"children":3268},{"style":225},[3269],{"type":39,"value":545},{"type":30,"tag":151,"props":3271,"children":3272},{"class":153,"line":548},[3273,3277,3282,3287,3291,3296,3300,3304,3308,3312,3316,3321,3326],{"type":30,"tag":151,"props":3274,"children":3275},{"style":208},[3276],{"type":39,"value":494},{"type":30,"tag":151,"props":3278,"children":3279},{"style":497},[3280],{"type":39,"value":3281}," (slot ",{"type":30,"tag":151,"props":3283,"children":3284},{"style":265},[3285],{"type":39,"value":3286},"==",{"type":30,"tag":151,"props":3288,"children":3289},{"style":421},[3290],{"type":39,"value":2804},{"type":30,"tag":151,"props":3292,"children":3293},{"style":265},[3294],{"type":39,"value":3295}," ||",{"type":30,"tag":151,"props":3297,"children":3298},{"style":497},[3299],{"type":39,"value":2696},{"type":30,"tag":151,"props":3301,"children":3302},{"style":579},[3303],{"type":39,"value":582},{"type":30,"tag":151,"props":3305,"children":3306},{"style":497},[3307],{"type":39,"value":752},{"type":30,"tag":151,"props":3309,"children":3310},{"style":265},[3311],{"type":39,"value":757},{"type":30,"tag":151,"props":3313,"children":3314},{"style":497},[3315],{"type":39,"value":762},{"type":30,"tag":151,"props":3317,"children":3318},{"style":208},[3319],{"type":39,"value":3320},"return",{"type":30,"tag":151,"props":3322,"children":3323},{"style":1724},[3324],{"type":39,"value":3325}," false",{"type":30,"tag":151,"props":3327,"children":3328},{"style":225},[3329],{"type":39,"value":545},{"type":30,"tag":151,"props":3331,"children":3332},{"class":153,"line":663},[3333,3337,3342,3346,3350,3354,3358,3363,3367,3372,3376],{"type":30,"tag":151,"props":3334,"children":3335},{"style":208},[3336],{"type":39,"value":554},{"type":30,"tag":151,"props":3338,"children":3339},{"style":557},[3340],{"type":39,"value":3341}," activeHolds",{"type":30,"tag":151,"props":3343,"children":3344},{"style":265},[3345],{"type":39,"value":565},{"type":30,"tag":151,"props":3347,"children":3348},{"style":208},[3349],{"type":39,"value":570},{"type":30,"tag":151,"props":3351,"children":3352},{"style":573},[3353],{"type":39,"value":576},{"type":30,"tag":151,"props":3355,"children":3356},{"style":579},[3357],{"type":39,"value":582},{"type":30,"tag":151,"props":3359,"children":3360},{"style":497},[3361],{"type":39,"value":3362},"slotHoldRepo",{"type":30,"tag":151,"props":3364,"children":3365},{"style":579},[3366],{"type":39,"value":582},{"type":30,"tag":151,"props":3368,"children":3369},{"style":192},[3370],{"type":39,"value":3371},"countActiveHolds",{"type":30,"tag":151,"props":3373,"children":3374},{"style":497},[3375],{"type":39,"value":3265},{"type":30,"tag":151,"props":3377,"children":3378},{"style":225},[3379],{"type":39,"value":545},{"type":30,"tag":151,"props":3381,"children":3382},{"class":153,"line":733},[3383,3387,3392,3396,3400],{"type":30,"tag":151,"props":3384,"children":3385},{"style":208},[3386],{"type":39,"value":2191},{"type":30,"tag":151,"props":3388,"children":3389},{"style":497},[3390],{"type":39,"value":3391}," activeHolds ",{"type":30,"tag":151,"props":3393,"children":3394},{"style":265},[3395],{"type":39,"value":818},{"type":30,"tag":151,"props":3397,"children":3398},{"style":1724},[3399],{"type":39,"value":2848},{"type":30,"tag":151,"props":3401,"children":3402},{"style":225},[3403],{"type":39,"value":545},{"type":30,"tag":151,"props":3405,"children":3406},{"class":153,"line":795},[3407],{"type":30,"tag":151,"props":3408,"children":3409},{"style":225},[3410],{"type":39,"value":2223},{"type":30,"tag":151,"props":3412,"children":3413},{"class":153,"line":861},[3414],{"type":30,"tag":151,"props":3415,"children":3416},{"style":225},[3417],{"type":39,"value":2232},{"type":30,"tag":31,"props":3419,"children":3420},{},[3421],{"type":39,"value":3422},"Sur crmcoaching, j'ai 47 use cases qui ne dépendent d'aucun module externe. Je peux faire tourner toute la logique métier en CI sans démarrer Postgres. Le jour où je voudrai migrer vers Drizzle, ce sera 2 jours de travail au lieu de plusieurs mois.",{"type":30,"tag":47,"props":3424,"children":3425},{},[],{"type":30,"tag":51,"props":3427,"children":3429},{"id":3428},"pattern-3-tests-qui-ne-testent-rien",[3430],{"type":39,"value":3431},"Pattern #3 : tests qui ne testent rien",{"type":30,"tag":31,"props":3433,"children":3434},{},[3435,3437,3443,3445,3451],{"type":39,"value":3436},"Celui-là me fait grincer des dents à chaque fois. Claude génère des tests qui ont l'air sérieux, avec des ",{"type":30,"tag":147,"props":3438,"children":3440},{"className":3439},[],[3441],{"type":39,"value":3442},"describe",{"type":39,"value":3444},", des ",{"type":30,"tag":147,"props":3446,"children":3448},{"className":3447},[],[3449],{"type":39,"value":3450},"vi.fn()",{"type":39,"value":3452},", des assertions, et qui ne testent en réalité aucun comportement métier. Exemple typique sur crmcoaching :",{"type":30,"tag":140,"props":3454,"children":3456},{"className":142,"code":3455,"language":144,"meta":7,"style":7},"// apps/api/src/application/use-cases/__tests__/create-mentoring-checkout-intent.test.ts\n// Test généré par Claude sans prompt de comportement\n\ndescribe('CreateMentoringCheckoutIntentUseCase', () => {\n  it('should call repository save', async () => {\n    const repo = { save: vi.fn().mockResolvedValue({ id: 'intent-1' }) };\n    const useCase = new CreateMentoringCheckoutIntentUseCase(repo as any);\n\n    await useCase.execute({ coachId: 'c1', clientId: 'cl1', offreId: 'o1' });\n\n    expect(repo.save).toHaveBeenCalledWith(\n      expect.objectContaining({ coachId: 'c1' }),\n    ); // vérifie un appel, pas un comportement\n  });\n});\n",[3457],{"type":30,"tag":147,"props":3458,"children":3459},{"__ignoreMap":7},[3460,3468,3476,3483,3517,3555,3645,3693,3700,3788,3795,3830,3879,3897,3913],{"type":30,"tag":151,"props":3461,"children":3462},{"class":153,"line":154},[3463],{"type":30,"tag":151,"props":3464,"children":3465},{"style":158},[3466],{"type":39,"value":3467},"// apps/api/src/application/use-cases/__tests__/create-mentoring-checkout-intent.test.ts\n",{"type":30,"tag":151,"props":3469,"children":3470},{"class":153,"line":164},[3471],{"type":30,"tag":151,"props":3472,"children":3473},{"style":158},[3474],{"type":39,"value":3475},"// Test généré par Claude sans prompt de comportement\n",{"type":30,"tag":151,"props":3477,"children":3478},{"class":153,"line":173},[3479],{"type":30,"tag":151,"props":3480,"children":3481},{"emptyLinePlaceholder":12},[3482],{"type":39,"value":179},{"type":30,"tag":151,"props":3484,"children":3485},{"class":153,"line":182},[3486,3490,3494,3499,3503,3508,3513],{"type":30,"tag":151,"props":3487,"children":3488},{"style":192},[3489],{"type":39,"value":3442},{"type":30,"tag":151,"props":3491,"children":3492},{"style":497},[3493],{"type":39,"value":409},{"type":30,"tag":151,"props":3495,"children":3496},{"style":533},[3497],{"type":39,"value":3498},"'CreateMentoringCheckoutIntentUseCase'",{"type":30,"tag":151,"props":3500,"children":3501},{"style":225},[3502],{"type":39,"value":429},{"type":30,"tag":151,"props":3504,"children":3505},{"style":225},[3506],{"type":39,"value":3507}," ()",{"type":30,"tag":151,"props":3509,"children":3510},{"style":265},[3511],{"type":39,"value":3512}," =>",{"type":30,"tag":151,"props":3514,"children":3515},{"style":225},[3516],{"type":39,"value":228},{"type":30,"tag":151,"props":3518,"children":3519},{"class":153,"line":204},[3520,3525,3529,3534,3538,3543,3547,3551],{"type":30,"tag":151,"props":3521,"children":3522},{"style":192},[3523],{"type":39,"value":3524},"  it",{"type":30,"tag":151,"props":3526,"children":3527},{"style":497},[3528],{"type":39,"value":409},{"type":30,"tag":151,"props":3530,"children":3531},{"style":533},[3532],{"type":39,"value":3533},"'should call repository save'",{"type":30,"tag":151,"props":3535,"children":3536},{"style":225},[3537],{"type":39,"value":429},{"type":30,"tag":151,"props":3539,"children":3540},{"style":208},[3541],{"type":39,"value":3542}," async",{"type":30,"tag":151,"props":3544,"children":3545},{"style":225},[3546],{"type":39,"value":3507},{"type":30,"tag":151,"props":3548,"children":3549},{"style":265},[3550],{"type":39,"value":3512},{"type":30,"tag":151,"props":3552,"children":3553},{"style":225},[3554],{"type":39,"value":228},{"type":30,"tag":151,"props":3556,"children":3557},{"class":153,"line":231},[3558,3562,3567,3571,3575,3580,3584,3589,3593,3598,3602,3606,3611,3615,3619,3623,3627,3632,3636,3640],{"type":30,"tag":151,"props":3559,"children":3560},{"style":208},[3561],{"type":39,"value":554},{"type":30,"tag":151,"props":3563,"children":3564},{"style":557},[3565],{"type":39,"value":3566}," repo",{"type":30,"tag":151,"props":3568,"children":3569},{"style":265},[3570],{"type":39,"value":565},{"type":30,"tag":151,"props":3572,"children":3573},{"style":225},[3574],{"type":39,"value":628},{"type":30,"tag":151,"props":3576,"children":3577},{"style":497},[3578],{"type":39,"value":3579}," save",{"type":30,"tag":151,"props":3581,"children":3582},{"style":579},[3583],{"type":39,"value":268},{"type":30,"tag":151,"props":3585,"children":3586},{"style":497},[3587],{"type":39,"value":3588}," vi",{"type":30,"tag":151,"props":3590,"children":3591},{"style":579},[3592],{"type":39,"value":582},{"type":30,"tag":151,"props":3594,"children":3595},{"style":192},[3596],{"type":39,"value":3597},"fn",{"type":30,"tag":151,"props":3599,"children":3600},{"style":497},[3601],{"type":39,"value":1487},{"type":30,"tag":151,"props":3603,"children":3604},{"style":579},[3605],{"type":39,"value":582},{"type":30,"tag":151,"props":3607,"children":3608},{"style":192},[3609],{"type":39,"value":3610},"mockResolvedValue",{"type":30,"tag":151,"props":3612,"children":3613},{"style":497},[3614],{"type":39,"value":409},{"type":30,"tag":151,"props":3616,"children":3617},{"style":225},[3618],{"type":39,"value":614},{"type":30,"tag":151,"props":3620,"children":3621},{"style":497},[3622],{"type":39,"value":633},{"type":30,"tag":151,"props":3624,"children":3625},{"style":579},[3626],{"type":39,"value":268},{"type":30,"tag":151,"props":3628,"children":3629},{"style":533},[3630],{"type":39,"value":3631}," 'intent-1'",{"type":30,"tag":151,"props":3633,"children":3634},{"style":225},[3635],{"type":39,"value":652},{"type":30,"tag":151,"props":3637,"children":3638},{"style":497},[3639],{"type":39,"value":828},{"type":30,"tag":151,"props":3641,"children":3642},{"style":225},[3643],{"type":39,"value":3644},"};\n",{"type":30,"tag":151,"props":3646,"children":3647},{"class":153,"line":245},[3648,3652,3657,3661,3665,3670,3675,3680,3685,3689],{"type":30,"tag":151,"props":3649,"children":3650},{"style":208},[3651],{"type":39,"value":554},{"type":30,"tag":151,"props":3653,"children":3654},{"style":557},[3655],{"type":39,"value":3656}," useCase",{"type":30,"tag":151,"props":3658,"children":3659},{"style":265},[3660],{"type":39,"value":565},{"type":30,"tag":151,"props":3662,"children":3663},{"style":518},[3664],{"type":39,"value":521},{"type":30,"tag":151,"props":3666,"children":3667},{"style":192},[3668],{"type":39,"value":3669}," CreateMentoringCheckoutIntentUseCase",{"type":30,"tag":151,"props":3671,"children":3672},{"style":497},[3673],{"type":39,"value":3674},"(repo ",{"type":30,"tag":151,"props":3676,"children":3677},{"style":208},[3678],{"type":39,"value":3679},"as",{"type":30,"tag":151,"props":3681,"children":3682},{"style":421},[3683],{"type":39,"value":3684}," any",{"type":30,"tag":151,"props":3686,"children":3687},{"style":497},[3688],{"type":39,"value":447},{"type":30,"tag":151,"props":3690,"children":3691},{"style":225},[3692],{"type":39,"value":545},{"type":30,"tag":151,"props":3694,"children":3695},{"class":153,"line":281},[3696],{"type":30,"tag":151,"props":3697,"children":3698},{"emptyLinePlaceholder":12},[3699],{"type":39,"value":179},{"type":30,"tag":151,"props":3701,"children":3702},{"class":153,"line":311},[3703,3707,3711,3715,3720,3724,3728,3732,3736,3741,3745,3749,3753,3758,3762,3767,3771,3776,3780,3784],{"type":30,"tag":151,"props":3704,"children":3705},{"style":208},[3706],{"type":39,"value":1362},{"type":30,"tag":151,"props":3708,"children":3709},{"style":497},[3710],{"type":39,"value":3656},{"type":30,"tag":151,"props":3712,"children":3713},{"style":579},[3714],{"type":39,"value":582},{"type":30,"tag":151,"props":3716,"children":3717},{"style":192},[3718],{"type":39,"value":3719},"execute",{"type":30,"tag":151,"props":3721,"children":3722},{"style":497},[3723],{"type":39,"value":409},{"type":30,"tag":151,"props":3725,"children":3726},{"style":225},[3727],{"type":39,"value":614},{"type":30,"tag":151,"props":3729,"children":3730},{"style":497},[3731],{"type":39,"value":434},{"type":30,"tag":151,"props":3733,"children":3734},{"style":579},[3735],{"type":39,"value":268},{"type":30,"tag":151,"props":3737,"children":3738},{"style":533},[3739],{"type":39,"value":3740}," 'c1'",{"type":30,"tag":151,"props":3742,"children":3743},{"style":225},[3744],{"type":39,"value":429},{"type":30,"tag":151,"props":3746,"children":3747},{"style":497},[3748],{"type":39,"value":2139},{"type":30,"tag":151,"props":3750,"children":3751},{"style":579},[3752],{"type":39,"value":268},{"type":30,"tag":151,"props":3754,"children":3755},{"style":533},[3756],{"type":39,"value":3757}," 'cl1'",{"type":30,"tag":151,"props":3759,"children":3760},{"style":225},[3761],{"type":39,"value":429},{"type":30,"tag":151,"props":3763,"children":3764},{"style":497},[3765],{"type":39,"value":3766}," offreId",{"type":30,"tag":151,"props":3768,"children":3769},{"style":579},[3770],{"type":39,"value":268},{"type":30,"tag":151,"props":3772,"children":3773},{"style":533},[3774],{"type":39,"value":3775}," 'o1'",{"type":30,"tag":151,"props":3777,"children":3778},{"style":225},[3779],{"type":39,"value":652},{"type":30,"tag":151,"props":3781,"children":3782},{"style":497},[3783],{"type":39,"value":447},{"type":30,"tag":151,"props":3785,"children":3786},{"style":225},[3787],{"type":39,"value":545},{"type":30,"tag":151,"props":3789,"children":3790},{"class":153,"line":341},[3791],{"type":30,"tag":151,"props":3792,"children":3793},{"emptyLinePlaceholder":12},[3794],{"type":39,"value":179},{"type":30,"tag":151,"props":3796,"children":3797},{"class":153,"line":371},[3798,3803,3808,3812,3817,3821,3826],{"type":30,"tag":151,"props":3799,"children":3800},{"style":192},[3801],{"type":39,"value":3802},"    expect",{"type":30,"tag":151,"props":3804,"children":3805},{"style":497},[3806],{"type":39,"value":3807},"(repo",{"type":30,"tag":151,"props":3809,"children":3810},{"style":579},[3811],{"type":39,"value":582},{"type":30,"tag":151,"props":3813,"children":3814},{"style":497},[3815],{"type":39,"value":3816},"save)",{"type":30,"tag":151,"props":3818,"children":3819},{"style":579},[3820],{"type":39,"value":582},{"type":30,"tag":151,"props":3822,"children":3823},{"style":192},[3824],{"type":39,"value":3825},"toHaveBeenCalledWith",{"type":30,"tag":151,"props":3827,"children":3828},{"style":497},[3829],{"type":39,"value":242},{"type":30,"tag":151,"props":3831,"children":3832},{"class":153,"line":385},[3833,3838,3842,3847,3851,3855,3859,3863,3867,3871,3875],{"type":30,"tag":151,"props":3834,"children":3835},{"style":497},[3836],{"type":39,"value":3837},"      expect",{"type":30,"tag":151,"props":3839,"children":3840},{"style":579},[3841],{"type":39,"value":582},{"type":30,"tag":151,"props":3843,"children":3844},{"style":192},[3845],{"type":39,"value":3846},"objectContaining",{"type":30,"tag":151,"props":3848,"children":3849},{"style":497},[3850],{"type":39,"value":409},{"type":30,"tag":151,"props":3852,"children":3853},{"style":225},[3854],{"type":39,"value":614},{"type":30,"tag":151,"props":3856,"children":3857},{"style":497},[3858],{"type":39,"value":434},{"type":30,"tag":151,"props":3860,"children":3861},{"style":579},[3862],{"type":39,"value":268},{"type":30,"tag":151,"props":3864,"children":3865},{"style":533},[3866],{"type":39,"value":3740},{"type":30,"tag":151,"props":3868,"children":3869},{"style":225},[3870],{"type":39,"value":652},{"type":30,"tag":151,"props":3872,"children":3873},{"style":497},[3874],{"type":39,"value":447},{"type":30,"tag":151,"props":3876,"children":3877},{"style":225},[3878],{"type":39,"value":278},{"type":30,"tag":151,"props":3880,"children":3881},{"class":153,"line":393},[3882,3887,3892],{"type":30,"tag":151,"props":3883,"children":3884},{"style":497},[3885],{"type":39,"value":3886},"    )",{"type":30,"tag":151,"props":3888,"children":3889},{"style":225},[3890],{"type":39,"value":3891},";",{"type":30,"tag":151,"props":3893,"children":3894},{"style":158},[3895],{"type":39,"value":3896}," // vérifie un appel, pas un comportement\n",{"type":30,"tag":151,"props":3898,"children":3899},{"class":153,"line":479},[3900,3905,3909],{"type":30,"tag":151,"props":3901,"children":3902},{"style":225},[3903],{"type":39,"value":3904},"  }",{"type":30,"tag":151,"props":3906,"children":3907},{"style":497},[3908],{"type":39,"value":447},{"type":30,"tag":151,"props":3910,"children":3911},{"style":225},[3912],{"type":39,"value":545},{"type":30,"tag":151,"props":3914,"children":3915},{"class":153,"line":488},[3916,3920,3924],{"type":30,"tag":151,"props":3917,"children":3918},{"style":225},[3919],{"type":39,"value":647},{"type":30,"tag":151,"props":3921,"children":3922},{"style":497},[3923],{"type":39,"value":447},{"type":30,"tag":151,"props":3925,"children":3926},{"style":225},[3927],{"type":39,"value":545},{"type":30,"tag":31,"props":3929,"children":3930},{},[3931],{"type":39,"value":3932},"Ce test ne dit rien. Il vérifie que la fonction appelle une autre fonction. C'est tautologique. Si vous changez l'implémentation pour utiliser un event store au lieu d'un repository, le test casse, sans qu'aucun comportement métier ait changé. C'est le pire des deux mondes : couplage fort à l'implémentation, zéro garantie de correction.",{"type":30,"tag":31,"props":3934,"children":3935},{},[3936,3938,3943],{"type":39,"value":3937},"Le contre-pattern, c'est ce que Dan North appelait ",{"type":30,"tag":98,"props":3939,"children":3940},{},[3941],{"type":39,"value":3942},"\"Tests as Specifications\"",{"type":39,"value":3944}," dans ses articles BDD fondateurs de 2006. Le test décrit un comportement observable :",{"type":30,"tag":140,"props":3946,"children":3948},{"className":142,"code":3947,"language":144,"meta":7,"style":7},"describe('CreateMentoringCheckoutIntentUseCase', () => {\n  it('étant donné une offre active, quand on crée l\\'intent, alors l\\'intent contient le prix de l\\'offre', async () => {\n    // Given\n    const offre = { id: 'o1', price: 150, currency: 'EUR', status: 'ACTIVE' };\n    const repo = new InMemoryCheckoutIntentRepository();\n    const offreRepo = new InMemoryOffreRepository([offre]);\n    const useCase = new CreateMentoringCheckoutIntentUseCase(repo, offreRepo);\n\n    // When\n    const result = await useCase.execute({ coachId: 'c1', clientId: 'cl1', offreId: 'o1' });\n\n    // Then\n    expect(result.amount).toBe(150);\n    expect(result.currency).toBe('EUR');\n    expect(result.status).toBe('PENDING');\n  });\n});\n",[3949],{"type":30,"tag":147,"props":3950,"children":3951},{"__ignoreMap":7},[3952,3983,4048,4056,4145,4177,4211,4251,4258,4266,4362,4369,4377,4424,4469,4514,4529],{"type":30,"tag":151,"props":3953,"children":3954},{"class":153,"line":154},[3955,3959,3963,3967,3971,3975,3979],{"type":30,"tag":151,"props":3956,"children":3957},{"style":192},[3958],{"type":39,"value":3442},{"type":30,"tag":151,"props":3960,"children":3961},{"style":497},[3962],{"type":39,"value":409},{"type":30,"tag":151,"props":3964,"children":3965},{"style":533},[3966],{"type":39,"value":3498},{"type":30,"tag":151,"props":3968,"children":3969},{"style":225},[3970],{"type":39,"value":429},{"type":30,"tag":151,"props":3972,"children":3973},{"style":225},[3974],{"type":39,"value":3507},{"type":30,"tag":151,"props":3976,"children":3977},{"style":265},[3978],{"type":39,"value":3512},{"type":30,"tag":151,"props":3980,"children":3981},{"style":225},[3982],{"type":39,"value":228},{"type":30,"tag":151,"props":3984,"children":3985},{"class":153,"line":164},[3986,3990,3994,3999,4005,4010,4014,4019,4023,4028,4032,4036,4040,4044],{"type":30,"tag":151,"props":3987,"children":3988},{"style":192},[3989],{"type":39,"value":3524},{"type":30,"tag":151,"props":3991,"children":3992},{"style":497},[3993],{"type":39,"value":409},{"type":30,"tag":151,"props":3995,"children":3996},{"style":533},[3997],{"type":39,"value":3998},"'étant donné une offre active, quand on crée l",{"type":30,"tag":151,"props":4000,"children":4002},{"style":4001},"--shiki-default:#F4B8E4;--shiki-dark:#79B8FF",[4003],{"type":39,"value":4004},"\\'",{"type":30,"tag":151,"props":4006,"children":4007},{"style":533},[4008],{"type":39,"value":4009},"intent, alors l",{"type":30,"tag":151,"props":4011,"children":4012},{"style":4001},[4013],{"type":39,"value":4004},{"type":30,"tag":151,"props":4015,"children":4016},{"style":533},[4017],{"type":39,"value":4018},"intent contient le prix de l",{"type":30,"tag":151,"props":4020,"children":4021},{"style":4001},[4022],{"type":39,"value":4004},{"type":30,"tag":151,"props":4024,"children":4025},{"style":533},[4026],{"type":39,"value":4027},"offre'",{"type":30,"tag":151,"props":4029,"children":4030},{"style":225},[4031],{"type":39,"value":429},{"type":30,"tag":151,"props":4033,"children":4034},{"style":208},[4035],{"type":39,"value":3542},{"type":30,"tag":151,"props":4037,"children":4038},{"style":225},[4039],{"type":39,"value":3507},{"type":30,"tag":151,"props":4041,"children":4042},{"style":265},[4043],{"type":39,"value":3512},{"type":30,"tag":151,"props":4045,"children":4046},{"style":225},[4047],{"type":39,"value":228},{"type":30,"tag":151,"props":4049,"children":4050},{"class":153,"line":173},[4051],{"type":30,"tag":151,"props":4052,"children":4053},{"style":158},[4054],{"type":39,"value":4055},"    // Given\n",{"type":30,"tag":151,"props":4057,"children":4058},{"class":153,"line":182},[4059,4063,4068,4072,4076,4080,4084,4088,4092,4097,4101,4106,4110,4115,4119,4124,4128,4132,4136,4140],{"type":30,"tag":151,"props":4060,"children":4061},{"style":208},[4062],{"type":39,"value":554},{"type":30,"tag":151,"props":4064,"children":4065},{"style":557},[4066],{"type":39,"value":4067}," offre",{"type":30,"tag":151,"props":4069,"children":4070},{"style":265},[4071],{"type":39,"value":565},{"type":30,"tag":151,"props":4073,"children":4074},{"style":225},[4075],{"type":39,"value":628},{"type":30,"tag":151,"props":4077,"children":4078},{"style":497},[4079],{"type":39,"value":633},{"type":30,"tag":151,"props":4081,"children":4082},{"style":579},[4083],{"type":39,"value":268},{"type":30,"tag":151,"props":4085,"children":4086},{"style":533},[4087],{"type":39,"value":3775},{"type":30,"tag":151,"props":4089,"children":4090},{"style":225},[4091],{"type":39,"value":429},{"type":30,"tag":151,"props":4093,"children":4094},{"style":497},[4095],{"type":39,"value":4096}," price",{"type":30,"tag":151,"props":4098,"children":4099},{"style":579},[4100],{"type":39,"value":268},{"type":30,"tag":151,"props":4102,"children":4103},{"style":1724},[4104],{"type":39,"value":4105}," 150",{"type":30,"tag":151,"props":4107,"children":4108},{"style":225},[4109],{"type":39,"value":429},{"type":30,"tag":151,"props":4111,"children":4112},{"style":497},[4113],{"type":39,"value":4114}," currency",{"type":30,"tag":151,"props":4116,"children":4117},{"style":579},[4118],{"type":39,"value":268},{"type":30,"tag":151,"props":4120,"children":4121},{"style":533},[4122],{"type":39,"value":4123}," 'EUR'",{"type":30,"tag":151,"props":4125,"children":4126},{"style":225},[4127],{"type":39,"value":429},{"type":30,"tag":151,"props":4129,"children":4130},{"style":497},[4131],{"type":39,"value":1452},{"type":30,"tag":151,"props":4133,"children":4134},{"style":579},[4135],{"type":39,"value":268},{"type":30,"tag":151,"props":4137,"children":4138},{"style":533},[4139],{"type":39,"value":1281},{"type":30,"tag":151,"props":4141,"children":4142},{"style":225},[4143],{"type":39,"value":4144}," };\n",{"type":30,"tag":151,"props":4146,"children":4147},{"class":153,"line":204},[4148,4152,4156,4160,4164,4169,4173],{"type":30,"tag":151,"props":4149,"children":4150},{"style":208},[4151],{"type":39,"value":554},{"type":30,"tag":151,"props":4153,"children":4154},{"style":557},[4155],{"type":39,"value":3566},{"type":30,"tag":151,"props":4157,"children":4158},{"style":265},[4159],{"type":39,"value":565},{"type":30,"tag":151,"props":4161,"children":4162},{"style":518},[4163],{"type":39,"value":521},{"type":30,"tag":151,"props":4165,"children":4166},{"style":192},[4167],{"type":39,"value":4168}," InMemoryCheckoutIntentRepository",{"type":30,"tag":151,"props":4170,"children":4171},{"style":497},[4172],{"type":39,"value":1487},{"type":30,"tag":151,"props":4174,"children":4175},{"style":225},[4176],{"type":39,"value":545},{"type":30,"tag":151,"props":4178,"children":4179},{"class":153,"line":231},[4180,4184,4189,4193,4197,4202,4207],{"type":30,"tag":151,"props":4181,"children":4182},{"style":208},[4183],{"type":39,"value":554},{"type":30,"tag":151,"props":4185,"children":4186},{"style":557},[4187],{"type":39,"value":4188}," offreRepo",{"type":30,"tag":151,"props":4190,"children":4191},{"style":265},[4192],{"type":39,"value":565},{"type":30,"tag":151,"props":4194,"children":4195},{"style":518},[4196],{"type":39,"value":521},{"type":30,"tag":151,"props":4198,"children":4199},{"style":192},[4200],{"type":39,"value":4201}," InMemoryOffreRepository",{"type":30,"tag":151,"props":4203,"children":4204},{"style":497},[4205],{"type":39,"value":4206},"([offre])",{"type":30,"tag":151,"props":4208,"children":4209},{"style":225},[4210],{"type":39,"value":545},{"type":30,"tag":151,"props":4212,"children":4213},{"class":153,"line":245},[4214,4218,4222,4226,4230,4234,4238,4242,4247],{"type":30,"tag":151,"props":4215,"children":4216},{"style":208},[4217],{"type":39,"value":554},{"type":30,"tag":151,"props":4219,"children":4220},{"style":557},[4221],{"type":39,"value":3656},{"type":30,"tag":151,"props":4223,"children":4224},{"style":265},[4225],{"type":39,"value":565},{"type":30,"tag":151,"props":4227,"children":4228},{"style":518},[4229],{"type":39,"value":521},{"type":30,"tag":151,"props":4231,"children":4232},{"style":192},[4233],{"type":39,"value":3669},{"type":30,"tag":151,"props":4235,"children":4236},{"style":497},[4237],{"type":39,"value":3807},{"type":30,"tag":151,"props":4239,"children":4240},{"style":225},[4241],{"type":39,"value":429},{"type":30,"tag":151,"props":4243,"children":4244},{"style":497},[4245],{"type":39,"value":4246}," offreRepo)",{"type":30,"tag":151,"props":4248,"children":4249},{"style":225},[4250],{"type":39,"value":545},{"type":30,"tag":151,"props":4252,"children":4253},{"class":153,"line":281},[4254],{"type":30,"tag":151,"props":4255,"children":4256},{"emptyLinePlaceholder":12},[4257],{"type":39,"value":179},{"type":30,"tag":151,"props":4259,"children":4260},{"class":153,"line":311},[4261],{"type":30,"tag":151,"props":4262,"children":4263},{"style":158},[4264],{"type":39,"value":4265},"    // When\n",{"type":30,"tag":151,"props":4267,"children":4268},{"class":153,"line":341},[4269,4273,4278,4282,4286,4290,4294,4298,4302,4306,4310,4314,4318,4322,4326,4330,4334,4338,4342,4346,4350,4354,4358],{"type":30,"tag":151,"props":4270,"children":4271},{"style":208},[4272],{"type":39,"value":554},{"type":30,"tag":151,"props":4274,"children":4275},{"style":557},[4276],{"type":39,"value":4277}," result",{"type":30,"tag":151,"props":4279,"children":4280},{"style":265},[4281],{"type":39,"value":565},{"type":30,"tag":151,"props":4283,"children":4284},{"style":208},[4285],{"type":39,"value":570},{"type":30,"tag":151,"props":4287,"children":4288},{"style":497},[4289],{"type":39,"value":3656},{"type":30,"tag":151,"props":4291,"children":4292},{"style":579},[4293],{"type":39,"value":582},{"type":30,"tag":151,"props":4295,"children":4296},{"style":192},[4297],{"type":39,"value":3719},{"type":30,"tag":151,"props":4299,"children":4300},{"style":497},[4301],{"type":39,"value":409},{"type":30,"tag":151,"props":4303,"children":4304},{"style":225},[4305],{"type":39,"value":614},{"type":30,"tag":151,"props":4307,"children":4308},{"style":497},[4309],{"type":39,"value":434},{"type":30,"tag":151,"props":4311,"children":4312},{"style":579},[4313],{"type":39,"value":268},{"type":30,"tag":151,"props":4315,"children":4316},{"style":533},[4317],{"type":39,"value":3740},{"type":30,"tag":151,"props":4319,"children":4320},{"style":225},[4321],{"type":39,"value":429},{"type":30,"tag":151,"props":4323,"children":4324},{"style":497},[4325],{"type":39,"value":2139},{"type":30,"tag":151,"props":4327,"children":4328},{"style":579},[4329],{"type":39,"value":268},{"type":30,"tag":151,"props":4331,"children":4332},{"style":533},[4333],{"type":39,"value":3757},{"type":30,"tag":151,"props":4335,"children":4336},{"style":225},[4337],{"type":39,"value":429},{"type":30,"tag":151,"props":4339,"children":4340},{"style":497},[4341],{"type":39,"value":3766},{"type":30,"tag":151,"props":4343,"children":4344},{"style":579},[4345],{"type":39,"value":268},{"type":30,"tag":151,"props":4347,"children":4348},{"style":533},[4349],{"type":39,"value":3775},{"type":30,"tag":151,"props":4351,"children":4352},{"style":225},[4353],{"type":39,"value":652},{"type":30,"tag":151,"props":4355,"children":4356},{"style":497},[4357],{"type":39,"value":447},{"type":30,"tag":151,"props":4359,"children":4360},{"style":225},[4361],{"type":39,"value":545},{"type":30,"tag":151,"props":4363,"children":4364},{"class":153,"line":371},[4365],{"type":30,"tag":151,"props":4366,"children":4367},{"emptyLinePlaceholder":12},[4368],{"type":39,"value":179},{"type":30,"tag":151,"props":4370,"children":4371},{"class":153,"line":385},[4372],{"type":30,"tag":151,"props":4373,"children":4374},{"style":158},[4375],{"type":39,"value":4376},"    // Then\n",{"type":30,"tag":151,"props":4378,"children":4379},{"class":153,"line":393},[4380,4384,4389,4393,4398,4402,4407,4411,4416,4420],{"type":30,"tag":151,"props":4381,"children":4382},{"style":192},[4383],{"type":39,"value":3802},{"type":30,"tag":151,"props":4385,"children":4386},{"style":497},[4387],{"type":39,"value":4388},"(result",{"type":30,"tag":151,"props":4390,"children":4391},{"style":579},[4392],{"type":39,"value":582},{"type":30,"tag":151,"props":4394,"children":4395},{"style":497},[4396],{"type":39,"value":4397},"amount)",{"type":30,"tag":151,"props":4399,"children":4400},{"style":579},[4401],{"type":39,"value":582},{"type":30,"tag":151,"props":4403,"children":4404},{"style":192},[4405],{"type":39,"value":4406},"toBe",{"type":30,"tag":151,"props":4408,"children":4409},{"style":497},[4410],{"type":39,"value":409},{"type":30,"tag":151,"props":4412,"children":4413},{"style":1724},[4414],{"type":39,"value":4415},"150",{"type":30,"tag":151,"props":4417,"children":4418},{"style":497},[4419],{"type":39,"value":447},{"type":30,"tag":151,"props":4421,"children":4422},{"style":225},[4423],{"type":39,"value":545},{"type":30,"tag":151,"props":4425,"children":4426},{"class":153,"line":479},[4427,4431,4435,4439,4444,4448,4452,4456,4461,4465],{"type":30,"tag":151,"props":4428,"children":4429},{"style":192},[4430],{"type":39,"value":3802},{"type":30,"tag":151,"props":4432,"children":4433},{"style":497},[4434],{"type":39,"value":4388},{"type":30,"tag":151,"props":4436,"children":4437},{"style":579},[4438],{"type":39,"value":582},{"type":30,"tag":151,"props":4440,"children":4441},{"style":497},[4442],{"type":39,"value":4443},"currency)",{"type":30,"tag":151,"props":4445,"children":4446},{"style":579},[4447],{"type":39,"value":582},{"type":30,"tag":151,"props":4449,"children":4450},{"style":192},[4451],{"type":39,"value":4406},{"type":30,"tag":151,"props":4453,"children":4454},{"style":497},[4455],{"type":39,"value":409},{"type":30,"tag":151,"props":4457,"children":4458},{"style":533},[4459],{"type":39,"value":4460},"'EUR'",{"type":30,"tag":151,"props":4462,"children":4463},{"style":497},[4464],{"type":39,"value":447},{"type":30,"tag":151,"props":4466,"children":4467},{"style":225},[4468],{"type":39,"value":545},{"type":30,"tag":151,"props":4470,"children":4471},{"class":153,"line":488},[4472,4476,4480,4484,4489,4493,4497,4501,4506,4510],{"type":30,"tag":151,"props":4473,"children":4474},{"style":192},[4475],{"type":39,"value":3802},{"type":30,"tag":151,"props":4477,"children":4478},{"style":497},[4479],{"type":39,"value":4388},{"type":30,"tag":151,"props":4481,"children":4482},{"style":579},[4483],{"type":39,"value":582},{"type":30,"tag":151,"props":4485,"children":4486},{"style":497},[4487],{"type":39,"value":4488},"status)",{"type":30,"tag":151,"props":4490,"children":4491},{"style":579},[4492],{"type":39,"value":582},{"type":30,"tag":151,"props":4494,"children":4495},{"style":192},[4496],{"type":39,"value":4406},{"type":30,"tag":151,"props":4498,"children":4499},{"style":497},[4500],{"type":39,"value":409},{"type":30,"tag":151,"props":4502,"children":4503},{"style":533},[4504],{"type":39,"value":4505},"'PENDING'",{"type":30,"tag":151,"props":4507,"children":4508},{"style":497},[4509],{"type":39,"value":447},{"type":30,"tag":151,"props":4511,"children":4512},{"style":225},[4513],{"type":39,"value":545},{"type":30,"tag":151,"props":4515,"children":4516},{"class":153,"line":548},[4517,4521,4525],{"type":30,"tag":151,"props":4518,"children":4519},{"style":225},[4520],{"type":39,"value":3904},{"type":30,"tag":151,"props":4522,"children":4523},{"style":497},[4524],{"type":39,"value":447},{"type":30,"tag":151,"props":4526,"children":4527},{"style":225},[4528],{"type":39,"value":545},{"type":30,"tag":151,"props":4530,"children":4531},{"class":153,"line":663},[4532,4536,4540],{"type":30,"tag":151,"props":4533,"children":4534},{"style":225},[4535],{"type":39,"value":647},{"type":30,"tag":151,"props":4537,"children":4538},{"style":497},[4539],{"type":39,"value":447},{"type":30,"tag":151,"props":4541,"children":4542},{"style":225},[4543],{"type":39,"value":545},{"type":30,"tag":31,"props":4545,"children":4546},{},[4547,4549,4555],{"type":39,"value":4548},"L'implémentation peut changer, le test reste valable. C'est exactement la philosophie défendue dans ",{"type":30,"tag":63,"props":4550,"children":4552},{"href":4551},"/fr/pratiques-agiles/adopter-behaviour-driven-development-bdd-guide-agile",[4553],{"type":39,"value":4554},"l'adoption du Behaviour-Driven Development",{"type":39,"value":4556}," et dans la Definition of Done bien posée.",{"type":30,"tag":31,"props":4558,"children":4559},{},[4560],{"type":39,"value":4561},"Sur crmcoaching, après avoir appliqué ce changement systématiquement, le ratio de tests \"behavior-level\" est passé de 15% à 70%. La couverture brute a parfois baissé. La couverture utile a triplé.",{"type":30,"tag":47,"props":4563,"children":4564},{},[],{"type":30,"tag":51,"props":4566,"children":4568},{"id":4567},"pattern-4-catch-all-silencieux",[4569],{"type":39,"value":4570},"Pattern #4 : catch-all silencieux",{"type":30,"tag":31,"props":4572,"children":4573},{},[4574],{"type":39,"value":4575},"C'est le pattern le plus dangereux, parce qu'il masque les bugs au lieu de les révéler. Claude écrit volontiers :",{"type":30,"tag":140,"props":4577,"children":4579},{"className":142,"code":4578,"language":144,"meta":7,"style":7},"// apps/api/src/infrastructure/adapters/brevo-notification.adapter.ts\n\nasync sendSlotConfirmation(clientEmail: string, slotId: string): Promise\u003Cvoid> {\n  try {\n    await this.brevoService.sendTransactionalEmail({\n      to: [{ email: clientEmail }],\n      templateId: 12,\n      params: { slotId },\n    });\n  } catch (e) {\n    console.error('notification failed', e);\n    // la suite s'exécute comme si tout allait bien\n  }\n}\n",[4580],{"type":30,"tag":147,"props":4581,"children":4582},{"__ignoreMap":7},[4583,4591,4598,4640,4652,4687,4731,4751,4774,4789,4801,4840,4848,4855],{"type":30,"tag":151,"props":4584,"children":4585},{"class":153,"line":154},[4586],{"type":30,"tag":151,"props":4587,"children":4588},{"style":158},[4589],{"type":39,"value":4590},"// apps/api/src/infrastructure/adapters/brevo-notification.adapter.ts\n",{"type":30,"tag":151,"props":4592,"children":4593},{"class":153,"line":164},[4594],{"type":30,"tag":151,"props":4595,"children":4596},{"emptyLinePlaceholder":12},[4597],{"type":39,"value":179},{"type":30,"tag":151,"props":4599,"children":4600},{"class":153,"line":173},[4601,4606,4611,4616,4620,4625,4631,4636],{"type":30,"tag":151,"props":4602,"children":4603},{"style":497},[4604],{"type":39,"value":4605},"async ",{"type":30,"tag":151,"props":4607,"children":4608},{"style":192},[4609],{"type":39,"value":4610},"sendSlotConfirmation",{"type":30,"tag":151,"props":4612,"children":4613},{"style":497},[4614],{"type":39,"value":4615},"(clientEmail: string",{"type":30,"tag":151,"props":4617,"children":4618},{"style":225},[4619],{"type":39,"value":429},{"type":30,"tag":151,"props":4621,"children":4622},{"style":497},[4623],{"type":39,"value":4624}," slotId: string): ",{"type":30,"tag":151,"props":4626,"children":4628},{"style":4627},"--shiki-default:#E5C890;--shiki-default-font-style:italic;--shiki-dark:#79B8FF;--shiki-dark-font-style:inherit",[4629],{"type":39,"value":4630},"Promise",{"type":30,"tag":151,"props":4632,"children":4633},{"style":265},[4634],{"type":39,"value":4635},"\u003Cvoid>",{"type":30,"tag":151,"props":4637,"children":4638},{"style":225},[4639],{"type":39,"value":228},{"type":30,"tag":151,"props":4641,"children":4642},{"class":153,"line":182},[4643,4648],{"type":30,"tag":151,"props":4644,"children":4645},{"style":497},[4646],{"type":39,"value":4647},"  try ",{"type":30,"tag":151,"props":4649,"children":4650},{"style":225},[4651],{"type":39,"value":918},{"type":30,"tag":151,"props":4653,"children":4654},{"class":153,"line":204},[4655,4659,4663,4667,4671,4675,4679,4683],{"type":30,"tag":151,"props":4656,"children":4657},{"style":208},[4658],{"type":39,"value":1362},{"type":30,"tag":151,"props":4660,"children":4661},{"style":573},[4662],{"type":39,"value":576},{"type":30,"tag":151,"props":4664,"children":4665},{"style":579},[4666],{"type":39,"value":582},{"type":30,"tag":151,"props":4668,"children":4669},{"style":497},[4670],{"type":39,"value":1571},{"type":30,"tag":151,"props":4672,"children":4673},{"style":579},[4674],{"type":39,"value":582},{"type":30,"tag":151,"props":4676,"children":4677},{"style":192},[4678],{"type":39,"value":1580},{"type":30,"tag":151,"props":4680,"children":4681},{"style":497},[4682],{"type":39,"value":409},{"type":30,"tag":151,"props":4684,"children":4685},{"style":225},[4686],{"type":39,"value":918},{"type":30,"tag":151,"props":4688,"children":4689},{"class":153,"line":231},[4690,4694,4698,4702,4706,4710,4714,4719,4723,4727],{"type":30,"tag":151,"props":4691,"children":4692},{"style":497},[4693],{"type":39,"value":1597},{"type":30,"tag":151,"props":4695,"children":4696},{"style":579},[4697],{"type":39,"value":268},{"type":30,"tag":151,"props":4699,"children":4700},{"style":497},[4701],{"type":39,"value":1606},{"type":30,"tag":151,"props":4703,"children":4704},{"style":225},[4705],{"type":39,"value":614},{"type":30,"tag":151,"props":4707,"children":4708},{"style":497},[4709],{"type":39,"value":940},{"type":30,"tag":151,"props":4711,"children":4712},{"style":579},[4713],{"type":39,"value":268},{"type":30,"tag":151,"props":4715,"children":4716},{"style":497},[4717],{"type":39,"value":4718}," clientEmail ",{"type":30,"tag":151,"props":4720,"children":4721},{"style":225},[4722],{"type":39,"value":647},{"type":30,"tag":151,"props":4724,"children":4725},{"style":497},[4726],{"type":39,"value":1704},{"type":30,"tag":151,"props":4728,"children":4729},{"style":225},[4730],{"type":39,"value":278},{"type":30,"tag":151,"props":4732,"children":4733},{"class":153,"line":245},[4734,4738,4742,4747],{"type":30,"tag":151,"props":4735,"children":4736},{"style":497},[4737],{"type":39,"value":1717},{"type":30,"tag":151,"props":4739,"children":4740},{"style":579},[4741],{"type":39,"value":268},{"type":30,"tag":151,"props":4743,"children":4744},{"style":1724},[4745],{"type":39,"value":4746}," 12",{"type":30,"tag":151,"props":4748,"children":4749},{"style":225},[4750],{"type":39,"value":278},{"type":30,"tag":151,"props":4752,"children":4753},{"class":153,"line":281},[4754,4758,4762,4766,4770],{"type":30,"tag":151,"props":4755,"children":4756},{"style":497},[4757],{"type":39,"value":1740},{"type":30,"tag":151,"props":4759,"children":4760},{"style":579},[4761],{"type":39,"value":268},{"type":30,"tag":151,"props":4763,"children":4764},{"style":225},[4765],{"type":39,"value":628},{"type":30,"tag":151,"props":4767,"children":4768},{"style":497},[4769],{"type":39,"value":2766},{"type":30,"tag":151,"props":4771,"children":4772},{"style":225},[4773],{"type":39,"value":971},{"type":30,"tag":151,"props":4775,"children":4776},{"class":153,"line":311},[4777,4781,4785],{"type":30,"tag":151,"props":4778,"children":4779},{"style":225},[4780],{"type":39,"value":980},{"type":30,"tag":151,"props":4782,"children":4783},{"style":497},[4784],{"type":39,"value":447},{"type":30,"tag":151,"props":4786,"children":4787},{"style":225},[4788],{"type":39,"value":545},{"type":30,"tag":151,"props":4790,"children":4791},{"class":153,"line":341},[4792,4796],{"type":30,"tag":151,"props":4793,"children":4794},{"style":225},[4795],{"type":39,"value":3904},{"type":30,"tag":151,"props":4797,"children":4798},{"style":497},[4799],{"type":39,"value":4800}," catch (e) {\n",{"type":30,"tag":151,"props":4802,"children":4803},{"class":153,"line":371},[4804,4809,4814,4818,4823,4827,4832,4836],{"type":30,"tag":151,"props":4805,"children":4806},{"style":497},[4807],{"type":39,"value":4808},"    console.",{"type":30,"tag":151,"props":4810,"children":4811},{"style":192},[4812],{"type":39,"value":4813},"error",{"type":30,"tag":151,"props":4815,"children":4816},{"style":225},[4817],{"type":39,"value":409},{"type":30,"tag":151,"props":4819,"children":4820},{"style":533},[4821],{"type":39,"value":4822},"'notification failed'",{"type":30,"tag":151,"props":4824,"children":4825},{"style":225},[4826],{"type":39,"value":429},{"type":30,"tag":151,"props":4828,"children":4829},{"style":259},[4830],{"type":39,"value":4831}," e",{"type":30,"tag":151,"props":4833,"children":4834},{"style":225},[4835],{"type":39,"value":447},{"type":30,"tag":151,"props":4837,"children":4838},{"style":497},[4839],{"type":39,"value":545},{"type":30,"tag":151,"props":4841,"children":4842},{"class":153,"line":385},[4843],{"type":30,"tag":151,"props":4844,"children":4845},{"style":158},[4846],{"type":39,"value":4847},"    // la suite s'exécute comme si tout allait bien\n",{"type":30,"tag":151,"props":4849,"children":4850},{"class":153,"line":393},[4851],{"type":30,"tag":151,"props":4852,"children":4853},{"style":225},[4854],{"type":39,"value":2223},{"type":30,"tag":151,"props":4856,"children":4857},{"class":153,"line":479},[4858],{"type":30,"tag":151,"props":4859,"children":4860},{"style":497},[4861],{"type":39,"value":2232},{"type":30,"tag":31,"props":4863,"children":4864},{},[4865,4867,4873],{"type":39,"value":4866},"Et la suite du code continue normalement. Le slot a-t-il été confirmé par email ? On ne sait pas. Le ",{"type":30,"tag":147,"props":4868,"children":4870},{"className":4869},[],[4871],{"type":39,"value":4872},"console.error",{"type":39,"value":4874}," est-il regardé par quelqu'un en prod ? Probablement pas. Le client voit \"Réservation confirmée\" alors que Brevo n'a rien envoyé.",{"type":30,"tag":31,"props":4876,"children":4877},{},[4878,4880,4886,4888,4894],{"type":39,"value":4879},"Le contre-pattern craft repose sur trois règles. D'abord, ne jamais avaler une exception sans politique explicite : soit on re-throw, soit on dégrade volontairement (tracé dans une métrique), soit on rollback. Ensuite, ne jamais utiliser ",{"type":30,"tag":147,"props":4881,"children":4883},{"className":4882},[],[4884],{"type":39,"value":4885},"catch (e)",{"type":39,"value":4887}," générique sans typer l'exception attendue : une erreur réseau Brevo ne se traite pas comme une ",{"type":30,"tag":147,"props":4889,"children":4891},{"className":4890},[],[4892],{"type":39,"value":4893},"DomainException",{"type":39,"value":4895},". Enfin, instrumenter chaque catch avec une métrique ou une alerte :",{"type":30,"tag":140,"props":4897,"children":4899},{"className":142,"code":4898,"language":144,"meta":7,"style":7},"async sendSlotConfirmation(clientEmail: string, slotId: string): Promise\u003Cvoid> {\n  try {\n    await this.brevoService.sendTransactionalEmail({\n      to: [{ email: clientEmail }],\n      templateId: 12,\n      params: { slotId },\n    });\n  } catch (err) {\n    this.logger.error('brevo.slot_confirmation.failed', {\n      clientEmail,\n      slotId,\n      error: err instanceof Error ? err.message : String(err),\n    });\n    this.metricsService.increment('notification_failures_total', { type: 'slot_confirmation' });\n    throw new NotificationDeliveryException(`Confirmation slot ${slotId} non envoyée`);\n  }\n}\n",[4900],{"type":30,"tag":147,"props":4901,"children":4902},{"__ignoreMap":7},[4903,4938,4949,4984,5027,5046,5069,5084,5096,5125,5137,5149,5214,5226,5271,5318,5325],{"type":30,"tag":151,"props":4904,"children":4905},{"class":153,"line":154},[4906,4910,4914,4918,4922,4926,4930,4934],{"type":30,"tag":151,"props":4907,"children":4908},{"style":497},[4909],{"type":39,"value":4605},{"type":30,"tag":151,"props":4911,"children":4912},{"style":192},[4913],{"type":39,"value":4610},{"type":30,"tag":151,"props":4915,"children":4916},{"style":497},[4917],{"type":39,"value":4615},{"type":30,"tag":151,"props":4919,"children":4920},{"style":225},[4921],{"type":39,"value":429},{"type":30,"tag":151,"props":4923,"children":4924},{"style":497},[4925],{"type":39,"value":4624},{"type":30,"tag":151,"props":4927,"children":4928},{"style":4627},[4929],{"type":39,"value":4630},{"type":30,"tag":151,"props":4931,"children":4932},{"style":265},[4933],{"type":39,"value":4635},{"type":30,"tag":151,"props":4935,"children":4936},{"style":225},[4937],{"type":39,"value":228},{"type":30,"tag":151,"props":4939,"children":4940},{"class":153,"line":164},[4941,4945],{"type":30,"tag":151,"props":4942,"children":4943},{"style":497},[4944],{"type":39,"value":4647},{"type":30,"tag":151,"props":4946,"children":4947},{"style":225},[4948],{"type":39,"value":918},{"type":30,"tag":151,"props":4950,"children":4951},{"class":153,"line":173},[4952,4956,4960,4964,4968,4972,4976,4980],{"type":30,"tag":151,"props":4953,"children":4954},{"style":208},[4955],{"type":39,"value":1362},{"type":30,"tag":151,"props":4957,"children":4958},{"style":573},[4959],{"type":39,"value":576},{"type":30,"tag":151,"props":4961,"children":4962},{"style":579},[4963],{"type":39,"value":582},{"type":30,"tag":151,"props":4965,"children":4966},{"style":497},[4967],{"type":39,"value":1571},{"type":30,"tag":151,"props":4969,"children":4970},{"style":579},[4971],{"type":39,"value":582},{"type":30,"tag":151,"props":4973,"children":4974},{"style":192},[4975],{"type":39,"value":1580},{"type":30,"tag":151,"props":4977,"children":4978},{"style":497},[4979],{"type":39,"value":409},{"type":30,"tag":151,"props":4981,"children":4982},{"style":225},[4983],{"type":39,"value":918},{"type":30,"tag":151,"props":4985,"children":4986},{"class":153,"line":182},[4987,4991,4995,4999,5003,5007,5011,5015,5019,5023],{"type":30,"tag":151,"props":4988,"children":4989},{"style":497},[4990],{"type":39,"value":1597},{"type":30,"tag":151,"props":4992,"children":4993},{"style":579},[4994],{"type":39,"value":268},{"type":30,"tag":151,"props":4996,"children":4997},{"style":497},[4998],{"type":39,"value":1606},{"type":30,"tag":151,"props":5000,"children":5001},{"style":225},[5002],{"type":39,"value":614},{"type":30,"tag":151,"props":5004,"children":5005},{"style":497},[5006],{"type":39,"value":940},{"type":30,"tag":151,"props":5008,"children":5009},{"style":579},[5010],{"type":39,"value":268},{"type":30,"tag":151,"props":5012,"children":5013},{"style":497},[5014],{"type":39,"value":4718},{"type":30,"tag":151,"props":5016,"children":5017},{"style":225},[5018],{"type":39,"value":647},{"type":30,"tag":151,"props":5020,"children":5021},{"style":497},[5022],{"type":39,"value":1704},{"type":30,"tag":151,"props":5024,"children":5025},{"style":225},[5026],{"type":39,"value":278},{"type":30,"tag":151,"props":5028,"children":5029},{"class":153,"line":204},[5030,5034,5038,5042],{"type":30,"tag":151,"props":5031,"children":5032},{"style":497},[5033],{"type":39,"value":1717},{"type":30,"tag":151,"props":5035,"children":5036},{"style":579},[5037],{"type":39,"value":268},{"type":30,"tag":151,"props":5039,"children":5040},{"style":1724},[5041],{"type":39,"value":4746},{"type":30,"tag":151,"props":5043,"children":5044},{"style":225},[5045],{"type":39,"value":278},{"type":30,"tag":151,"props":5047,"children":5048},{"class":153,"line":231},[5049,5053,5057,5061,5065],{"type":30,"tag":151,"props":5050,"children":5051},{"style":497},[5052],{"type":39,"value":1740},{"type":30,"tag":151,"props":5054,"children":5055},{"style":579},[5056],{"type":39,"value":268},{"type":30,"tag":151,"props":5058,"children":5059},{"style":225},[5060],{"type":39,"value":628},{"type":30,"tag":151,"props":5062,"children":5063},{"style":497},[5064],{"type":39,"value":2766},{"type":30,"tag":151,"props":5066,"children":5067},{"style":225},[5068],{"type":39,"value":971},{"type":30,"tag":151,"props":5070,"children":5071},{"class":153,"line":245},[5072,5076,5080],{"type":30,"tag":151,"props":5073,"children":5074},{"style":225},[5075],{"type":39,"value":980},{"type":30,"tag":151,"props":5077,"children":5078},{"style":497},[5079],{"type":39,"value":447},{"type":30,"tag":151,"props":5081,"children":5082},{"style":225},[5083],{"type":39,"value":545},{"type":30,"tag":151,"props":5085,"children":5086},{"class":153,"line":281},[5087,5091],{"type":30,"tag":151,"props":5088,"children":5089},{"style":225},[5090],{"type":39,"value":3904},{"type":30,"tag":151,"props":5092,"children":5093},{"style":497},[5094],{"type":39,"value":5095}," catch (err) {\n",{"type":30,"tag":151,"props":5097,"children":5098},{"class":153,"line":311},[5099,5104,5108,5112,5117,5121],{"type":30,"tag":151,"props":5100,"children":5101},{"style":497},[5102],{"type":39,"value":5103},"    this.logger.",{"type":30,"tag":151,"props":5105,"children":5106},{"style":192},[5107],{"type":39,"value":4813},{"type":30,"tag":151,"props":5109,"children":5110},{"style":225},[5111],{"type":39,"value":409},{"type":30,"tag":151,"props":5113,"children":5114},{"style":533},[5115],{"type":39,"value":5116},"'brevo.slot_confirmation.failed'",{"type":30,"tag":151,"props":5118,"children":5119},{"style":225},[5120],{"type":39,"value":429},{"type":30,"tag":151,"props":5122,"children":5123},{"style":225},[5124],{"type":39,"value":228},{"type":30,"tag":151,"props":5126,"children":5127},{"class":153,"line":341},[5128,5133],{"type":30,"tag":151,"props":5129,"children":5130},{"style":259},[5131],{"type":39,"value":5132},"      clientEmail",{"type":30,"tag":151,"props":5134,"children":5135},{"style":225},[5136],{"type":39,"value":278},{"type":30,"tag":151,"props":5138,"children":5139},{"class":153,"line":371},[5140,5145],{"type":30,"tag":151,"props":5141,"children":5142},{"style":259},[5143],{"type":39,"value":5144},"      slotId",{"type":30,"tag":151,"props":5146,"children":5147},{"style":225},[5148],{"type":39,"value":278},{"type":30,"tag":151,"props":5150,"children":5151},{"class":153,"line":385},[5152,5158,5162,5167,5172,5177,5182,5187,5191,5196,5200,5205,5210],{"type":30,"tag":151,"props":5153,"children":5155},{"style":5154},"--shiki-default:#C6D0F5;--shiki-dark:#FFAB70",[5156],{"type":39,"value":5157},"      error",{"type":30,"tag":151,"props":5159,"children":5160},{"style":225},[5161],{"type":39,"value":268},{"type":30,"tag":151,"props":5163,"children":5164},{"style":259},[5165],{"type":39,"value":5166}," err",{"type":30,"tag":151,"props":5168,"children":5169},{"style":259},[5170],{"type":39,"value":5171}," instanceof",{"type":30,"tag":151,"props":5173,"children":5174},{"style":259},[5175],{"type":39,"value":5176}," Error",{"type":30,"tag":151,"props":5178,"children":5179},{"style":497},[5180],{"type":39,"value":5181}," ? ",{"type":30,"tag":151,"props":5183,"children":5184},{"style":259},[5185],{"type":39,"value":5186},"err",{"type":30,"tag":151,"props":5188,"children":5189},{"style":497},[5190],{"type":39,"value":582},{"type":30,"tag":151,"props":5192,"children":5193},{"style":5154},[5194],{"type":39,"value":5195},"message",{"type":30,"tag":151,"props":5197,"children":5198},{"style":225},[5199],{"type":39,"value":2328},{"type":30,"tag":151,"props":5201,"children":5202},{"style":259},[5203],{"type":39,"value":5204}," String",{"type":30,"tag":151,"props":5206,"children":5207},{"style":497},[5208],{"type":39,"value":5209},"(err)",{"type":30,"tag":151,"props":5211,"children":5212},{"style":225},[5213],{"type":39,"value":278},{"type":30,"tag":151,"props":5215,"children":5216},{"class":153,"line":393},[5217,5222],{"type":30,"tag":151,"props":5218,"children":5219},{"style":225},[5220],{"type":39,"value":5221},"    })",{"type":30,"tag":151,"props":5223,"children":5224},{"style":497},[5225],{"type":39,"value":545},{"type":30,"tag":151,"props":5227,"children":5228},{"class":153,"line":479},[5229,5234,5239,5243,5247,5253,5257,5262,5266],{"type":30,"tag":151,"props":5230,"children":5231},{"style":497},[5232],{"type":39,"value":5233},"    this.metricsService.increment(",{"type":30,"tag":151,"props":5235,"children":5236},{"style":533},[5237],{"type":39,"value":5238},"'notification_failures_total'",{"type":30,"tag":151,"props":5240,"children":5241},{"style":225},[5242],{"type":39,"value":429},{"type":30,"tag":151,"props":5244,"children":5245},{"style":225},[5246],{"type":39,"value":628},{"type":30,"tag":151,"props":5248,"children":5250},{"style":5249},"--shiki-default:#C6D0F5;--shiki-dark:#B392F0",[5251],{"type":39,"value":5252}," type",{"type":30,"tag":151,"props":5254,"children":5255},{"style":225},[5256],{"type":39,"value":268},{"type":30,"tag":151,"props":5258,"children":5259},{"style":533},[5260],{"type":39,"value":5261}," 'slot_confirmation'",{"type":30,"tag":151,"props":5263,"children":5264},{"style":225},[5265],{"type":39,"value":652},{"type":30,"tag":151,"props":5267,"children":5268},{"style":497},[5269],{"type":39,"value":5270},");\n",{"type":30,"tag":151,"props":5272,"children":5273},{"class":153,"line":488},[5274,5279,5284,5288,5293,5297,5301,5305,5310,5314],{"type":30,"tag":151,"props":5275,"children":5276},{"style":497},[5277],{"type":39,"value":5278},"    throw new ",{"type":30,"tag":151,"props":5280,"children":5281},{"style":192},[5282],{"type":39,"value":5283},"NotificationDeliveryException",{"type":30,"tag":151,"props":5285,"children":5286},{"style":225},[5287],{"type":39,"value":409},{"type":30,"tag":151,"props":5289,"children":5290},{"style":533},[5291],{"type":39,"value":5292},"`Confirmation slot ",{"type":30,"tag":151,"props":5294,"children":5295},{"style":706},[5296],{"type":39,"value":709},{"type":30,"tag":151,"props":5298,"children":5299},{"style":497},[5300],{"type":39,"value":2474},{"type":30,"tag":151,"props":5302,"children":5303},{"style":706},[5304],{"type":39,"value":647},{"type":30,"tag":151,"props":5306,"children":5307},{"style":533},[5308],{"type":39,"value":5309}," non envoyée`",{"type":30,"tag":151,"props":5311,"children":5312},{"style":225},[5313],{"type":39,"value":447},{"type":30,"tag":151,"props":5315,"children":5316},{"style":497},[5317],{"type":39,"value":545},{"type":30,"tag":151,"props":5319,"children":5320},{"class":153,"line":548},[5321],{"type":30,"tag":151,"props":5322,"children":5323},{"style":225},[5324],{"type":39,"value":2223},{"type":30,"tag":151,"props":5326,"children":5327},{"class":153,"line":663},[5328],{"type":30,"tag":151,"props":5329,"children":5330},{"style":497},[5331],{"type":39,"value":2232},{"type":30,"tag":31,"props":5333,"children":5334},{},[5335,5337,5342,5344,5350],{"type":39,"value":5336},"Michael Nygard a documenté ce sujet en profondeur dans ",{"type":30,"tag":98,"props":5338,"children":5339},{},[5340],{"type":39,"value":5341},"Release It!",{"type":39,"value":5343}," (2007). Les ",{"type":30,"tag":63,"props":5345,"children":5347},{"href":5346},"/fr/architecture-craft/patterns-resilience-circuit-breaker-retry",[5348],{"type":39,"value":5349},"patterns de résilience type circuit breaker et retry",{"type":39,"value":5351}," n'ont de sens que si les erreurs sont visibles. Un catch-all silencieux casse toute la stratégie de résilience en amont.",{"type":30,"tag":47,"props":5353,"children":5354},{},[],{"type":30,"tag":51,"props":5356,"children":5358},{"id":5357},"pattern-5-dépendances-non-auditées",[5359],{"type":39,"value":5360},"Pattern #5 : dépendances non auditées",{"type":30,"tag":31,"props":5362,"children":5363},{},[5364,5366,5372,5374,5380,5382,5388,5390,5396],{"type":39,"value":5365},"Le dernier pattern est le plus invisible. Claude propose une dépendance pour résoudre un problème : \"Ajoute ",{"type":30,"tag":147,"props":5367,"children":5369},{"className":5368},[],[5370],{"type":39,"value":5371},"stripe",{"type":39,"value":5373}," pour les checkouts\", \"Utilise ",{"type":30,"tag":147,"props":5375,"children":5377},{"className":5376},[],[5378],{"type":39,"value":5379},"jose",{"type":39,"value":5381}," pour signer ce token\", \"Importe ",{"type":30,"tag":147,"props":5383,"children":5385},{"className":5384},[],[5386],{"type":39,"value":5387},"date-fns",{"type":39,"value":5389}," pour ce calcul de durée\". Le développeur lance ",{"type":30,"tag":147,"props":5391,"children":5393},{"className":5392},[],[5394],{"type":39,"value":5395},"pnpm add \u003Cpkg>",{"type":39,"value":5397},", ça compile, ça passe les tests, ça merge. Et l'artefact entre dans le repo, sans audit, sans justification.",{"type":30,"tag":31,"props":5399,"children":5400},{},[5401,5403,5409],{"type":39,"value":5402},"Le problème, ce sont les chiffres du Snyk Open Source Security Report 2024 : les attaques sur la supply chain ont augmenté de 156% en un an. Les écosystèmes les plus touchés incluent npm, PyPI et Maven Central, précisément ceux que Claude suggère le plus. Sur le cas xz-utils (CVE-2024-3094, mars 2024), une backdoor s'est glissée pendant 2 ans dans un package que tout le monde utilisait sans relire. Le sujet de fond est traité dans ",{"type":30,"tag":63,"props":5404,"children":5406},{"href":5405},"/fr/intelligence-artificielle/llm-securite-code-vulnerabilites",[5407],{"type":39,"value":5408},"les vulnérabilités de sécurité dans le code LLM-généré",{"type":39,"value":582},{"type":30,"tag":31,"props":5411,"children":5412},{},[5413,5415,5421,5423,5429],{"type":39,"value":5414},"Le contre-pattern craft repose sur 3 réflexes. D'abord, refuser toute nouvelle dépendance qui n'a pas été justifiée par un commentaire de PR (quelle alternative native Node ? quel score de vulnérabilités npm audit ? combien de mainteneurs actifs ?). Ensuite, mesurer la ",{"type":30,"tag":147,"props":5416,"children":5418},{"className":5417},[],[5419],{"type":39,"value":5420},"time-to-patch",{"type":39,"value":5422}," sur les CVE critiques (en dessous de 7 jours = sain). Enfin, automatiser la veille via ",{"type":30,"tag":63,"props":5424,"children":5426},{"href":5425},"/fr/dette-technique/dependabot-craft-gestion-dependances",[5427],{"type":39,"value":5428},"Dependabot configuré craft",{"type":39,"value":5430}," avec auto-merge sur les patches et review humaine sur les majors.",{"type":30,"tag":31,"props":5432,"children":5433},{},[5434,5436,5442],{"type":39,"value":5435},"Sur crmcoaching, j'audite chaque dépendance que Claude propose. Je vérifie le nombre de mainteneurs, la date du dernier commit, le score ",{"type":30,"tag":147,"props":5437,"children":5439},{"className":5438},[],[5440],{"type":39,"value":5441},"pnpm audit",{"type":39,"value":5443},". 30 secondes par dépendance. C'est ce qui fait la différence entre un repo sain et un repo qui exfiltre des données dans 2 ans.",{"type":30,"tag":47,"props":5445,"children":5446},{},[],{"type":30,"tag":51,"props":5448,"children":5450},{"id":5449},"les-5-garde-fous-craft-à-installer-dès-lundi",[5451],{"type":39,"value":5452},"Les 5 garde-fous craft à installer dès lundi",{"type":30,"tag":31,"props":5454,"children":5455},{},[5456],{"type":39,"value":5457},"Voici la grille condensée. Mettez-la en checklist GitHub PR template.",{"type":30,"tag":5459,"props":5460,"children":5461},"table",{},[5462,5486],{"type":30,"tag":5463,"props":5464,"children":5465},"thead",{},[5466],{"type":30,"tag":5467,"props":5468,"children":5469},"tr",{},[5470,5476,5481],{"type":30,"tag":5471,"props":5472,"children":5473},"th",{},[5474],{"type":39,"value":5475},"Pattern",{"type":30,"tag":5471,"props":5477,"children":5478},{},[5479],{"type":39,"value":5480},"Signal en review",{"type":30,"tag":5471,"props":5482,"children":5483},{},[5484],{"type":39,"value":5485},"Contre-pattern craft",{"type":30,"tag":5487,"props":5488,"children":5489},"tbody",{},[5490,5509,5551,5575,5599],{"type":30,"tag":5467,"props":5491,"children":5492},{},[5493,5499,5504],{"type":30,"tag":5494,"props":5495,"children":5496},"td",{},[5497],{"type":39,"value":5498},"God Function",{"type":30,"tag":5494,"props":5500,"children":5501},{},[5502],{"type":39,"value":5503},"Fonction > 40 lignes ou > 3 niveaux d'indentation",{"type":30,"tag":5494,"props":5505,"children":5506},{},[5507],{"type":39,"value":5508},"Découpe SRP en sous-fonctions nommées",{"type":30,"tag":5467,"props":5510,"children":5511},{},[5512,5517,5541],{"type":30,"tag":5494,"props":5513,"children":5514},{},[5515],{"type":39,"value":5516},"Couplage ORM",{"type":30,"tag":5494,"props":5518,"children":5519},{},[5520,5525,5527,5533,5535],{"type":30,"tag":147,"props":5521,"children":5523},{"className":5522},[],[5524],{"type":39,"value":2313},{"type":39,"value":5526}," injecté dans ",{"type":30,"tag":147,"props":5528,"children":5530},{"className":5529},[],[5531],{"type":39,"value":5532},"application/",{"type":39,"value":5534}," ou ",{"type":30,"tag":147,"props":5536,"children":5538},{"className":5537},[],[5539],{"type":39,"value":5540},"domain/",{"type":30,"tag":5494,"props":5542,"children":5543},{},[5544,5546],{"type":39,"value":5545},"Interface Repository (port), adapter Prisma en ",{"type":30,"tag":147,"props":5547,"children":5549},{"className":5548},[],[5550],{"type":39,"value":2916},{"type":30,"tag":5467,"props":5552,"children":5553},{},[5554,5559,5570],{"type":30,"tag":5494,"props":5555,"children":5556},{},[5557],{"type":39,"value":5558},"Tests vides",{"type":30,"tag":5494,"props":5560,"children":5561},{},[5562,5568],{"type":30,"tag":147,"props":5563,"children":5565},{"className":5564},[],[5566],{"type":39,"value":5567},"expect(repo.save).toHaveBeenCalled()",{"type":39,"value":5569}," sans assertion comportementale",{"type":30,"tag":5494,"props":5571,"children":5572},{},[5573],{"type":39,"value":5574},"Format Given/When/Then sur comportement observable",{"type":30,"tag":5467,"props":5576,"children":5577},{},[5578,5583,5594],{"type":30,"tag":5494,"props":5579,"children":5580},{},[5581],{"type":39,"value":5582},"Catch-all silencieux",{"type":30,"tag":5494,"props":5584,"children":5585},{},[5586,5592],{"type":30,"tag":147,"props":5587,"children":5589},{"className":5588},[],[5590],{"type":39,"value":5591},"catch (e) { console.error(e) }",{"type":39,"value":5593}," sans politique",{"type":30,"tag":5494,"props":5595,"children":5596},{},[5597],{"type":39,"value":5598},"Re-throw typé, métrique, ou rollback",{"type":30,"tag":5467,"props":5600,"children":5601},{},[5602,5607,5620],{"type":30,"tag":5494,"props":5603,"children":5604},{},[5605],{"type":39,"value":5606},"Dépendance non auditée",{"type":30,"tag":5494,"props":5608,"children":5609},{},[5610,5612,5618],{"type":39,"value":5611},"Entrée ",{"type":30,"tag":147,"props":5613,"children":5615},{"className":5614},[],[5616],{"type":39,"value":5617},"package.json",{"type":39,"value":5619}," sans commentaire de justification",{"type":30,"tag":5494,"props":5621,"children":5622},{},[5623,5625,5630],{"type":39,"value":5624},"Audit 30 sec (",{"type":30,"tag":147,"props":5626,"children":5628},{"className":5627},[],[5629],{"type":39,"value":5441},{"type":39,"value":5631},") + Dependabot configuré craft",{"type":30,"tag":31,"props":5633,"children":5634},{},[5635],{"type":39,"value":5636},"Cette grille tient en 5 minutes par PR. Elle attrape 80% des patterns dangereux que j'ai vus en construisant crmcoaching et lors de mes accompagnements. Elle s'inscrit naturellement dans la philosophie Boy Scout Rule : on laisse le code un peu mieux qu'on l'a trouvé, à chaque PR.",{"type":30,"tag":47,"props":5638,"children":5639},{},[],{"type":30,"tag":5641,"props":5642,"children":5647},"cta",{"cta":5643,"href":5644,"title":5645,"type":5646},"Coder comme un senior →","https://app.kamanga.fr/forms/mentoring","Vous voulez voir ces patterns dans une PR Claude avant qu'ils ne deviennent de la dette ?","call",[5648],{"type":30,"tag":31,"props":5649,"children":5650},{},[5651],{"type":39,"value":5652},"Repérer une God Function ou un catch-all silencieux dans une suggestion de Claude, ça ne s'apprend pas en lisant un article : ça se travaille. En mentoring 1:1, je relis votre code avec vous, on rejoue vos prompts, et on installe ensemble le réflexe de review qui transforme Claude en exécutant discipliné. Vous repartez en voyant ce que le modèle ne voit pas.",{"type":30,"tag":47,"props":5654,"children":5655},{},[],{"type":30,"tag":51,"props":5657,"children":5659},{"id":5658},"ce-que-ça-change-concrètement",[5660],{"type":39,"value":5661},"Ce que ça change concrètement",{"type":30,"tag":31,"props":5663,"children":5664},{},[5665],{"type":39,"value":5666},"Sur crmcoaching, après avoir installé cette grille et appliqué une vraie discipline de code review, voici les chiffres avant/après mesurés sur 6 mois.",{"type":30,"tag":5459,"props":5668,"children":5669},{},[5670,5691],{"type":30,"tag":5463,"props":5671,"children":5672},{},[5673],{"type":30,"tag":5467,"props":5674,"children":5675},{},[5676,5681,5686],{"type":30,"tag":5471,"props":5677,"children":5678},{},[5679],{"type":39,"value":5680},"Métrique",{"type":30,"tag":5471,"props":5682,"children":5683},{},[5684],{"type":39,"value":5685},"Avant grille",{"type":30,"tag":5471,"props":5687,"children":5688},{},[5689],{"type":39,"value":5690},"Après 6 mois",{"type":30,"tag":5487,"props":5692,"children":5693},{},[5694,5712,5730,5748,5766],{"type":30,"tag":5467,"props":5695,"children":5696},{},[5697,5702,5707],{"type":30,"tag":5494,"props":5698,"children":5699},{},[5700],{"type":39,"value":5701},"Fonctions > 40 lignes dans le repo",{"type":30,"tag":5494,"props":5703,"children":5704},{},[5705],{"type":39,"value":5706},"22% des fonctions",{"type":30,"tag":5494,"props":5708,"children":5709},{},[5710],{"type":39,"value":5711},"4% des fonctions",{"type":30,"tag":5467,"props":5713,"children":5714},{},[5715,5720,5725],{"type":30,"tag":5494,"props":5716,"children":5717},{},[5718],{"type":39,"value":5719},"Couverture de tests behavior-level",{"type":30,"tag":5494,"props":5721,"children":5722},{},[5723],{"type":39,"value":5724},"15%",{"type":30,"tag":5494,"props":5726,"children":5727},{},[5728],{"type":39,"value":5729},"70%",{"type":30,"tag":5467,"props":5731,"children":5732},{},[5733,5738,5743],{"type":30,"tag":5494,"props":5734,"children":5735},{},[5736],{"type":39,"value":5737},"Incidents prod liés à exception swallowed",{"type":30,"tag":5494,"props":5739,"children":5740},{},[5741],{"type":39,"value":5742},"4 par trimestre",{"type":30,"tag":5494,"props":5744,"children":5745},{},[5746],{"type":39,"value":5747},"0 par trimestre",{"type":30,"tag":5467,"props":5749,"children":5750},{},[5751,5756,5761],{"type":30,"tag":5494,"props":5752,"children":5753},{},[5754],{"type":39,"value":5755},"Time-to-patch CVE critique",{"type":30,"tag":5494,"props":5757,"children":5758},{},[5759],{"type":39,"value":5760},"38 jours",{"type":30,"tag":5494,"props":5762,"children":5763},{},[5764],{"type":39,"value":5765},"6 jours",{"type":30,"tag":5467,"props":5767,"children":5768},{},[5769,5774,5779],{"type":30,"tag":5494,"props":5770,"children":5771},{},[5772],{"type":39,"value":5773},"Heures consacrées au refactoring d'urgence",{"type":30,"tag":5494,"props":5775,"children":5776},{},[5777],{"type":39,"value":5778},"12h/semaine",{"type":30,"tag":5494,"props":5780,"children":5781},{},[5782],{"type":39,"value":5783},"3h/semaine",{"type":30,"tag":31,"props":5785,"children":5786},{},[5787,5789,5795],{"type":39,"value":5788},"Le gain est mesurable, et il est financier. Une heure de dev senior coûte entre 80 et 150 euros chargée. Économiser 9 heures par semaine, c'est une différence considérable sur l'année. Pour une équipe qui a peur de \"ralentir\" en imposant des règles de review, le calcul retourne le sens : c'est l'absence de règles qui ralentit, pas leur présence. C'est exactement l'angle que je détaille dans ",{"type":30,"tag":63,"props":5790,"children":5792},{"href":5791},"/fr/dette-technique/ingenierie-logicielle-avantage-concurrentiel",[5793],{"type":39,"value":5794},"l'ingénierie logicielle comme avantage concurrentiel",{"type":39,"value":582},{"type":30,"tag":47,"props":5797,"children":5798},{},[],{"type":30,"tag":51,"props":5800,"children":5802},{"id":5801},"conclusion",[5803],{"type":39,"value":5804},"Conclusion",{"type":30,"tag":31,"props":5806,"children":5807},{},[5808],{"type":39,"value":5809},"Ce que je veux que vous reteniez de cet article, c'est que Claude n'écrit pas de mauvais code par malveillance. Il écrit le code statistiquement moyen de son training data, et ce code moyen est plein d'anti-patterns silencieux que les équipes humaines apprenaient à éviter en 5 ans de mentoring. Sans grille explicite, ces patterns rentrent dans votre repo à 2 PR par jour, et au bout de 12 mois votre dette technique a triplé.",{"type":30,"tag":31,"props":5811,"children":5812},{},[5813],{"type":39,"value":5814},"La bonne nouvelle, c'est que Claude répond très bien à un prompt précis et à un contre-pattern nommé. Il n'a pas d'ego. Il ne défend pas ses choix. Si vous lui dites \"réécris ce use case en respectant le SRP, chaque helper de moins de 20 lignes\", il s'exécute proprement. Le craft, en 2026, consiste à savoir nommer les patterns qu'on attend, à les imposer en review, et à transformer Claude en exécutant discipliné plutôt qu'en générateur de moyenne statistique.",{"type":30,"tag":31,"props":5816,"children":5817},{},[5818],{"type":39,"value":5819},"Si en lisant ces lignes vous reconnaissez votre situation, vous avez deux choix. Vous pouvez laisser les 5 patterns s'installer un peu plus chaque jour. Ou vous pouvez commencer lundi matin, par une grille de 5 questions en review, et reprendre le contrôle de votre codebase.",{"type":30,"tag":31,"props":5821,"children":5822},{},[5823,5825,5832],{"type":39,"value":5824},"Pour suivre la suite des patterns craft que je documente chaque semaine, retrouvez-moi sur ",{"type":30,"tag":63,"props":5826,"children":5829},{"href":5827,"rel":5828},"https://www.instagram.com/kamangacode/",[67],[5830],{"type":39,"value":5831},"mon profil Instagram kamangacode",{"type":39,"value":582},{"type":30,"tag":47,"props":5834,"children":5835},{},[],{"type":30,"tag":5641,"props":5837,"children":5842},{"cta":5838,"href":5839,"title":5840,"type":5841},"Les 100 pratiques que l'IA n'enseigne pas →","https://kamanga.fr/referentiel-craft","Ces 5 garde-fous ne sont qu'un début : il en existe 100","product",[5843],{"type":30,"tag":31,"props":5844,"children":5845},{},[5846],{"type":39,"value":5847},"La grille de review décrite ici neutralise 5 anti-patterns que Claude reproduit en silence. Elle fait partie d'un référentiel bien plus large : le Craft Bundle, les 100 pratiques craft que j'applique pour coder propre. Ce sont celles que l'IA ne vous apprendra jamais, parce qu'elle ne les a jamais vues tenir en production sur le long terme.",{"type":30,"tag":47,"props":5849,"children":5850},{},[],{"type":30,"tag":51,"props":5852,"children":5854},{"id":5853},"faq-sur-les-anti-patterns-claude-et-la-review-craft",[5855],{"type":39,"value":5856},"FAQ sur les anti-patterns Claude et la review craft",{"type":30,"tag":5858,"props":5859,"children":5860},"details",{},[5861,5867],{"type":30,"tag":5862,"props":5863,"children":5864},"summary",{},[5865],{"type":39,"value":5866},"1. Comment introduire cette grille sans braquer une équipe qui aime Claude ?",{"type":30,"tag":31,"props":5868,"children":5869},{},[5870],{"type":39,"value":5871},"La meilleure approche que j'ai vue, c'est de présenter la grille non comme \"Claude écrit du mauvais code\" mais comme \"Claude écrit le code moyen, et notre standard est plus haut que la moyenne\". L'équipe ne se sent pas attaquée, elle se sent élevée. Combiné à une démo concrète sur leur propre repo (3 exemples de God Function trouvés en 5 minutes), l'adhésion vient en 2 sprints. C'est aussi ce que permet une vraie culture engineering de rituels bien posée.",{"type":30,"tag":5858,"props":5873,"children":5874},{},[5875,5880],{"type":30,"tag":5862,"props":5876,"children":5877},{},[5878],{"type":39,"value":5879},"2. Faut-il refuser Claude sur les use cases critiques (paiement, auth) ?",{"type":30,"tag":31,"props":5881,"children":5882},{},[5883,5885,5890],{"type":39,"value":5884},"Non, mais il faut prompter différemment. Sur du critique, je donne explicitement à Claude le contexte de concurrence, de criticité, et les patterns attendus. Exemple : ",{"type":30,"tag":98,"props":5886,"children":5887},{},[5888],{"type":39,"value":5889},"\"Ce use case gère un checkout Stripe sur un SaaS multi-tenant. Utilise une transaction Prisma, type les exceptions, ne swallow rien.\"",{"type":39,"value":5891}," Le résultat est radicalement meilleur.",{"type":30,"tag":5858,"props":5893,"children":5894},{},[5895,5900],{"type":30,"tag":5862,"props":5896,"children":5897},{},[5898],{"type":39,"value":5899},"3. Comment automatiser la détection de ces 5 patterns ?",{"type":30,"tag":31,"props":5901,"children":5902},{},[5903,5905,5911,5913,5919,5921,5926,5928,5933],{"type":39,"value":5904},"Partiellement. Biome détecte les fonctions trop longues (",{"type":30,"tag":147,"props":5906,"children":5908},{"className":5907},[],[5909],{"type":39,"value":5910},"noExcessiveLinesPerFunction",{"type":39,"value":5912},"), la complexité cognitive (",{"type":30,"tag":147,"props":5914,"children":5916},{"className":5915},[],[5917],{"type":39,"value":5918},"noExcessiveCognitiveComplexity",{"type":39,"value":5920},"), et les ",{"type":30,"tag":147,"props":5922,"children":5924},{"className":5923},[],[5925],{"type":39,"value":4885},{"type":39,"value":5927}," génériques. Les patterns \"tests vides\" et \"dépendances non auditées\" demandent une vigilance humaine ou des outils spécialisés (Vitest coverage + mutation testing pour les tests, ",{"type":30,"tag":147,"props":5929,"children":5931},{"className":5930},[],[5932],{"type":39,"value":5441},{"type":39,"value":5934}," + Dependabot pour les packages npm). L'arsenal complet est détaillé dans les outils d'analyse statique en 2026.",{"type":30,"tag":5858,"props":5936,"children":5937},{},[5938,5943],{"type":30,"tag":5862,"props":5939,"children":5940},{},[5941],{"type":39,"value":5942},"4. Le pattern God Function vient-il vraiment de Claude ou existait-il déjà ?",{"type":30,"tag":31,"props":5944,"children":5945},{},[5946],{"type":39,"value":5947},"Il existait déjà, mais Claude l'amplifie. Avant 2023, une fonction de 80 lignes existait dans 8% des PR humaines selon mes mesures. En 2025, elle existe dans 23% des PR contenant du code IA-généré non révisé. L'IA ne crée pas le pattern, elle le multiplie par 3.",{"type":30,"tag":5858,"props":5949,"children":5950},{},[5951,5956],{"type":30,"tag":5862,"props":5952,"children":5953},{},[5954],{"type":39,"value":5955},"5. Quelle taille maximum recommander pour une fonction ?",{"type":30,"tag":31,"props":5957,"children":5958},{},[5959,5961,5965,5967,5972],{"type":39,"value":5960},"Robert C. Martin disait dans ",{"type":30,"tag":98,"props":5962,"children":5963},{},[5964],{"type":39,"value":102},{"type":39,"value":5966}," : \"Functions should be small. Then they should be smaller than that.\" Concrètement, je m'impose 20 lignes maximum pour une fonction métier, 5 niveaux d'indentation maximum, 3 paramètres maximum (au-delà, c'est un objet). Ce sont des règles arbitraires, mais elles forcent à découper. Sur crmcoaching, 94% des fonctions respectent ces seuils, et Biome (",{"type":30,"tag":147,"props":5968,"children":5970},{"className":5969},[],[5971],{"type":39,"value":5910},{"type":39,"value":5973},") fait échouer le lint si on dépasse.",{"type":30,"tag":5858,"props":5975,"children":5976},{},[5977,5982],{"type":30,"tag":5862,"props":5978,"children":5979},{},[5980],{"type":39,"value":5981},"6. Les tests behavior-level ne ralentissent-ils pas la CI ?",{"type":30,"tag":31,"props":5983,"children":5984},{},[5985],{"type":39,"value":5986},"Au contraire. Les tests behavior-level sont souvent plus rapides que les tests unitaires couplés à l'implémentation, parce qu'ils ne re-testent pas la même chose à 5 endroits. Sur crmcoaching, la CI tourne en 4 minutes pour 1 200 tests behavior-level. Le facteur limitant n'est plus le temps, c'est la qualité du test, ce qui est aussi le sujet de fond traité dans la checklist pour tester du code généré par IA.",{"type":30,"tag":47,"props":5988,"children":5989},{},[],{"type":30,"tag":5641,"props":5991,"children":5996},{"cta":5992,"href":5993,"title":5994,"type":5995},"Évaluer la maturité de mon équipe →","/mes-ressources","Ressource gratuite : Engineering Maturity Assessment","resource",[5997],{"type":30,"tag":31,"props":5998,"children":5999},{},[6000],{"type":39,"value":6001},"L'EMA est l'outil que je propose au début de chaque mission. Il mesure la maturité de votre équipe sur plusieurs axes engineering : qualité du code, gouvernance IA, dette technique, code review. Quelques minutes pour identifier lequel des 5 patterns vous touche le plus, et où concentrer vos efforts en priorité.",{"type":30,"tag":6003,"props":6004,"children":6005},"style",{},[6006],{"type":39,"value":6007},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":7,"searchDepth":164,"depth":164,"links":6009},[6010,6011,6012,6013,6014,6015,6016,6017,6018,6019],{"id":53,"depth":164,"text":56},{"id":125,"depth":164,"text":128},{"id":2299,"depth":164,"text":2302},{"id":3428,"depth":164,"text":3431},{"id":4567,"depth":164,"text":4570},{"id":5357,"depth":164,"text":5360},{"id":5449,"depth":164,"text":5452},{"id":5658,"depth":164,"text":5661},{"id":5801,"depth":164,"text":5804},{"id":5853,"depth":164,"text":5856},"markdown","content:fr:intelligence-artificielle:5-patterns-dangereux-claude.md","content","fr/intelligence-artificielle/5-patterns-dangereux-claude.md","fr/intelligence-artificielle/5-patterns-dangereux-claude","md",1782669243226]