Skip to content

IA-976 : `feat: Add cardLast4 enrichment to InvoiceDTO`

khadija.elbachouri a demandé de fusionner feature/IA-976 vers develop

MR Description

Summary

Extends InvoiceDTO with the parent's default card last 4 digits, fetched from the local PaymentDetailsRepository during DTO enrichment.

Changes

InvoiceDTO

  • Added cardLast4 field (String) InvoiceDTOEnricher
  • Injected PaymentDetailsRepository
  • Added a second enrichment block that looks up the parent's default active card (defaultCard = true, active = true) and sets cardLast4 on the DTO
  • Each enrichment block is independently wrapped in try/catch to prevent a card lookup failure from breaking parent info enrichment PaymentDetailsRepository
  • Added derived query method:
    Optional<PaymentDetails> findByParentUuidAndDefaultCardTrueAndActiveTrue(String parentUuid);

Rapports de requête de fusion