Commit Graph

6 Commits

Author SHA1 Message Date
Ho Ngoc Hai
a8edfd1597 fix(p2): Wave 3 — fix 4 P2 backend architecture issues (TEC-261)
BACK-I-01: Add CI steps to generate openapi.yaml for all 24 .NET services
- Add .config/dotnet-tools.json with swashbuckle.aspnetcore.cli 7.2.0
- Add scripts/ci/generate-openapi.sh reusable script
- Update all 24 service CI workflows with dotnet tool restore + swagger tofile + artifact upload

BACK-I-02: Add OpenTelemetry Metrics + Prometheus /metrics to _template_dot_net
- Add OTel packages (Extensions.Hosting, Instrumentation.AspNetCore, Runtime, Prometheus)
- Register AddOpenTelemetry().WithMetrics() with ASPNetCore + Runtime instrumentation
- Map MapPrometheusScrapingEndpoint("/metrics") in middleware pipeline

BACK-W-01: Remove IHttpContextAccessor from all 18 handler files in merchant-service-net
- Create MerchantBaseController abstract base with GetCurrentUserId() helper
- Add Guid UserId to 11 Commands and 7 Queries
- Remove IHttpContextAccessor injection from all handlers, use request.UserId instead
- Update 7 controllers to inherit MerchantBaseController and extract userId from JWT claims
- Remove AddHttpContextAccessor() registration from Program.cs

BACK-W-03: Add explicit commandTimeout:5 to all Dapper queries in order-service-net
- 14 files updated: QueryAsync, ExecuteScalarAsync, QueryFirstOrDefaultAsync all get commandTimeout: 5

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-23 10:09:45 +07:00
Ho Ngoc Hai
97b54ebd39 fix(security): fix 5 P1 backend issues — BACK-C-01/03/04, BACK-W-02
BACK-W-02: Replace string-interpolated SET LOCAL SQL with parameterized
set_config() calls in TenantMiddleware across 5 services (order, wallet,
inventory, catalog, fnb-engine). Eliminates SQL injection pattern;
set_config(key, $1, true) is local-to-transaction, same semantics as SET LOCAL.

BACK-C-01: Remove AllowAnyOrigin() from all 26 services. Switch to
WithOrigins() reading AllowedOrigins config array, with dev-only fallback
to localhost. In production, set AllowedOrigins=["https://goodgo.vn",
"https://admin.goodgo.vn"] via environment config.

BACK-C-03: Standardize OrdersController GET /orders/{id} 404 response
from {Message:...} to {success:false, error:{code,message}} per API contract.

BACK-C-04: Add complete ProblemDetails exception mappings to _template_dot_net:
ValidationException -> 400, DomainException -> 422, with TODO comments
for service-specific types (EntityNotFoundException -> 404, etc.).

BACK-C-02: wallet-service and booking-service already have full
IRequestManager idempotency implementation — no changes needed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-23 09:48:22 +07:00
Ho Ngoc Hai
66d87ac865 feat(docs): Remove ARCHITECTURE.md and README.md for project simplification
- Deleted ARCHITECTURE.md and README.md files to streamline the project structure and eliminate outdated documentation.
- This change aims to enhance usability and focus on more relevant resources for users.
2026-01-12 12:22:54 +07:00
Ho Ngoc Hai
aa7a0d9ee2 feat(docs): Revise .env.example and architecture documentation for clarity and updates
- Simplified the .env.example file by removing outdated comments and consolidating environment variable descriptions.
- Updated the architecture documentation to reflect the new structure and components of the .NET 10 microservice template.
- Enhanced clarity in the README.md to provide a more comprehensive overview of the template's features and requirements.
- Removed obsolete appsettings files to streamline the project structure and improve usability.
2026-01-10 21:52:09 +07:00
Ho Ngoc Hai
2cfbd0706f feat(docs): Add Redis Cache integration details to Vietnamese documentation
- Updated README.md to include Redis Cache integration as a new feature.
- Enhanced DependencyInjection.cs to register Redis Cache services and connection settings.
- Improved clarity in Vietnamese documentation regarding Clean Architecture principles.
2026-01-10 21:24:18 +07:00
Ho Ngoc Hai
0b0241143a feat(docs): Enhance Vietnamese documentation with updated diagrams and troubleshooting sections
- Improved Mermaid diagrams for better visual clarity and consistency across guides.
- Added detailed troubleshooting sections to assist users in diagnosing common issues effectively.
- Updated formatting and structure to align with the English version, ensuring consistency.
- Included quick tips and common issues sections to facilitate user navigation.
2026-01-10 21:21:41 +07:00