Skip to content

Develop#9

Merged
lmoraesdev merged 40 commits into
mainfrom
develop
Jul 7, 2026
Merged

Develop#9
lmoraesdev merged 40 commits into
mainfrom
develop

Conversation

@lmoraesdev

Copy link
Copy Markdown
Owner

No description provided.

lmoraesdev added 30 commits June 3, 2026 22:34
- datafaker 2.4.2 (test scope) for realistic test data generation
- jacoco-maven-plugin 0.8.13 with prepare-agent + report executions
- bind @{argLine} in Surefire so JaCoCo agent is picked up at initialize phase
…r and testing guide

- AbstractIntegrationTest: @SpringBootTest + @testcontainers + postgres:18-alpine base
- ChargeTestData: fluent builder for Charge domain object in tests
- TESTING.md: documents the Node/TS→Java test pattern migration
- Remove PaymentApiApplicationIT (replaced by focused slice tests)
Log charge_created in INFO after successful save, capturing the
business event without leaking infrastructure details.
…400/422/500)

- MethodArgumentNotValidException → 400 with per-field errors map and traceId
- DomainException → 422 with message and traceId
- Exception (unexpected) → 500 logged in ERROR; only case where 4xx are never logged
- @order(HIGHEST_PRECEDENCE) ensures this handler wins over Spring Boot's ProblemDetailsExceptionHandler
- TestcontainersConfiguration: shared postgres:17-alpine container with @Serviceconnection
- AbstractIntegrationTest: @DataJpaTest slice + @AutoConfigureTestDatabase(replace=NONE)
  so persistence tests use real Postgres instead of H2
…on for invalid amount

InvalidAmountException extends DomainException (code=INVALID_AMOUNT), so the
existing 422 handler picks it up automatically. IllegalArgumentException is now
reserved for genuine programming errors that should surface as 500.
lmoraesdev and others added 10 commits June 5, 2026 17:04
feat(charge): implement create charge domain — EPIC-001
- Expand jakarta.persistence.* star import to explicit imports
- Add braces to single-line if statements in Charge.equals()
feat(charge): implement create charge domain — EPIC-001
- springdoc-openapi-starter-webmvc-ui 2.8.17
- OpenApiConfig with project info and contact
- @tag / @operation / @ApiResponses on ChargeController (201, 400, 422, 500)
- @Schema on CreateChargeRequest and CreateChargeResponse with examples
- springdoc paths configured in application.yml
- Swagger UI: /swagger-ui.html  |  Spec: /v3/api-docs
- Status table with EPIC progress (001 done, 002/003/008 roadmap)
- Updated stack table with SpringDoc 2.8.17
- Accurate package tree showing implemented classes
- API section with request/response examples and error format
- Endpoints table includes Swagger UI and OpenAPI spec URLs
- Tests table documenting each test class and coverage
- Roadmap replaced by EPIC status table
spring.application.name=payment-api added to application.yml (default for
host-mode dev) and SPRING_APPLICATION_NAME env var added to docker-compose.yml
(immediate effect on the running container without rebuild). Fixes Jaeger
reporting traces as unknown_service.
Banking systems must not use floating-point for money. Changes:
- Money: compact constructor now normalises to scale=2 (RoundingMode.UNNECESSARY);
  amounts with more than 2 decimal places throw InvalidAmountException.
- ChargeJpaEntity: BigDecimal amount → Long amountCentavos (BIGINT in PostgreSQL).
  Column renamed to amount_centavos for self-documentation.
- ChargeMapper: toEntity converts via movePointRight(2).longValueExact();
  toDomain reconstructs via BigDecimal.valueOf(centavos, 2).
- README: documents the centavos storage decision and corrects minor inaccuracies.

All 21 tests (16 unit + 5 IT) green. Schema verified: amount_centavos bigint.
feat(charge): EPIC-001 — create charge vertical slice (domain → REST → tests)
@lmoraesdev
lmoraesdev merged commit e69ef32 into main Jul 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant