75 fichiers, ~1 mois de travail depuis f222861 (17/07). Contenu :
Onboarding self-service — jamais exécuté de bout en bout
OnboardingController, StripeWebhookController, StripeService, ResendEmailService
+ IEmailService (10 templates), EmailTemplates/, TrialLifecycleService (Hangfire),
PasswordTokenHelper, SlugHelper, 5 DTOs. Essai 14 j, Stripe customer/Checkout/Tax,
mot de passe oublié + invitation user, plafond IA d'essai.
Schéma Postgres v3 — passe pendant que la base est vide
ContentEmbedding + index HNSW (vector_cosine_ops), IEmbeddingService +
GoogleEmbeddingService (gemini-embedding-001, 768 dims), Deployment/Dockerfile.postgres
(postgis 3.4.3 + pgvector 0.8.6, épinglé par digest — un tag mobile rejouerait le
warning de collation glibc). Colonnes Resource : StoragePath, FileName,
IncludeInAiKnowledge, AiIndexStatus + nouveaux ResourceType ajoutés EN FIN d'enum.
Guide IA
Champs Guide* sur Instance + InstanceDTO, AssistantService lit la configuration client
dans les 4 blocs de prompt (ton codé en dur retiré, règle hors-sujet ajoutée aux deux
variantes qui n'en avaient pas), IHttpClientFactory à la place des new HttpClient().
Table VisitorQuestion + ConversationId sur AiChatRequest.
Stats
Rétention unifiée à 13 mois (instances ET plans), VisitEventPurgeService.
Nettoyage
IsStepLocked / IsHiddenInitially / FactContent supprimés de GuidedStep — IsStepLocked
rendait une étape définitivement infranchissable même après réussite.
SectionMap allégé (-57 lignes).
Tests
SectionParcoursControllerTests, FakeConfiguration, FakeEmailService.
ContentEmbedding a cassé 116 tests sur 124 (EF InMemory ne connaît pas Vector) :
l'entité est exclue quand le provider n'est pas Npgsql. Conséquence assumée —
le vector store n'est couvert par aucun test. dotnet test 124/124.
10 migrations EF. Base locale à jour, dotnet build 0 erreur.
Rien n'est en prod : la bascule Mongo → Postgres est décrite dans DOCS/STATUS.md §1quinquies.
⚠️ appsettings.json contient les clés Stripe (test) et Resend (prod) en clair — à rotationner.
54 lines
2.3 KiB
C#
54 lines
2.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using ManagerService.Services;
|
|
|
|
namespace ManagerService.Tests.Infrastructure
|
|
{
|
|
/// <summary>
|
|
/// Enregistre les envois au lieu de les effectuer, pour pouvoir asserter
|
|
/// qu'un flux déclenche bien le bon email sans dépendre de Resend.
|
|
/// </summary>
|
|
public class FakeEmailService : IEmailService
|
|
{
|
|
public record SentEmail(string Kind, string To);
|
|
|
|
public List<SentEmail> Sent { get; } = new();
|
|
|
|
private Task Record(string kind, string to)
|
|
{
|
|
Sent.Add(new SentEmail(kind, to));
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task SendWelcomeEmailAsync(string toEmail, string firstName, string loginUrl)
|
|
=> Record(nameof(SendWelcomeEmailAsync), toEmail);
|
|
|
|
public Task SendTrialStartedEmailAsync(string toEmail, string firstName, System.DateTime trialEndsAt)
|
|
=> Record(nameof(SendTrialStartedEmailAsync), toEmail);
|
|
|
|
public Task SendTrialCheckInEmailAsync(string toEmail, string firstName)
|
|
=> Record(nameof(SendTrialCheckInEmailAsync), toEmail);
|
|
|
|
public Task SendTrialEndingReminderEmailAsync(string toEmail, string firstName, System.DateTime trialEndsAt, string checkoutUrl)
|
|
=> Record(nameof(SendTrialEndingReminderEmailAsync), toEmail);
|
|
|
|
public Task SendTrialLastDayEmailAsync(string toEmail, string firstName, string checkoutUrl)
|
|
=> Record(nameof(SendTrialLastDayEmailAsync), toEmail);
|
|
|
|
public Task SendPaymentConfirmedEmailAsync(string toEmail, string firstName)
|
|
=> Record(nameof(SendPaymentConfirmedEmailAsync), toEmail);
|
|
|
|
public Task SendPaymentFailedEmailAsync(string toEmail, string firstName, string customerPortalUrl)
|
|
=> Record(nameof(SendPaymentFailedEmailAsync), toEmail);
|
|
|
|
public Task SendUserInvitationEmailAsync(string toEmail, string setPasswordUrl)
|
|
=> Record(nameof(SendUserInvitationEmailAsync), toEmail);
|
|
|
|
public Task SendPasswordResetEmailAsync(string toEmail, string firstName, string resetUrl)
|
|
=> Record(nameof(SendPasswordResetEmailAsync), toEmail);
|
|
|
|
public Task NotifyAdminAsync(string subject, string message)
|
|
=> Record(nameof(NotifyAdminAsync), subject);
|
|
}
|
|
}
|