Tast/ssad 93/create email microservice#114
Conversation
…ervices, interfaces
DrFaust555
left a comment
There was a problem hiding this comment.
Problems
- dockerpassword.env with password in repository
DB_PASSWORD=Strong_Pass_123!D32@
The password file is commiked. You need to delete it, add it to .gitignore, create .env.example.
-
Main API does not register MassTransit
EmailController now depends on IPublishEndpoint (MassTransit), but in ServiceCollectionExtensions.cs Main API old email logic is removed without adding MassTransit. When running there will be a DI exception — IPublishEndpoint is not registered. -
CI — 0% coverage, 6.3% duplication
build.yml is not updated for new Streetcode.Email.* projects — tests do not run in CI. -
Down() migration — bug
// First renames: Emails → Feedbacks, Content → Message
// Then references old names:
migrationBuilder.AlterColumn(name: "Content", table: "Emails", ...);
// Should be: name: "Message", table: "Feedbacks"
5. RabbitMQ host hardcoded
cfg.Host("localhost", "/"); // will not work in container/deploy
Need to read from configuration.
-
EmailService.SendEmailAsync without try-catch — SMTP operations without error handling. Hangfire job will silently fail.
-
Duplicate Hangfire dashboard
if (app.Environment.EnvironmentName == "Local")
app.UseHangfireDashboard("/dash"); // once
// ...
app.UseHangfireDashboard("/dash"); // once — always executed
Dashboard is open to all environments.
-
Content MaxLength mismatch — Validator: MaximumLength(100), Entity: [MaxLength(1000)], DB: maxLength: 1000. Validator truncates to 100 characters, although the database allows 1000.
-
Incomplete rename Feedback → Email:
Variable feedbackEntity in SendEmailHandler
Test namespace: Streetcode.Email.XUnitTest.MediatR.Feedback
Test names: ShouldReturnError_IfFeedbackIsNull, Handle_ShouldReturnOk_WhenFeedbackIsSavedSuccessfully
10. EF Core version mismatch — test project uses InMemory 9.0.13, DAL — EF Core 8.0.23. Major version mismatch.
|
All problems was fixed |
|
DrFaust555
left a comment
There was a problem hiding this comment.
Add changes from PR #120 (Test Email API step in build.yml) directly to this PR, because now they block each other — this PR fails without a test step in CI, and PR #120 fails because the project is not yet on dev. After that, close PR #120 as unnecessary. The rest of the comments are fixed, after adding build.yml you can merge.


dev
JIRA
Code reviewers
Summary of issue
Implement microservice than sending feedbackEmail
Summary of change
Microservice Architecture: Developed a dedicated email microservice to decouple mail logic from the main API.
Integration: Implemented RabbitMQ (via MassTransit) for reliable data transfer between services.
Background Processing: Integrated Hangfire and MailKit for resilient asynchronous email delivery to Streetcode Admin.
DevOps: Added docker-compose configuration and environment setups for local and containerized development.
Refactoring: Fully migrated from the old Feedback entity to the new Email structure (including DB migrations) and removed legacy logic.
Quality: Verified the flow with unit tests and manual integration testing.
CHECK LIST