Skip to content

Feature/repository layer#5

Merged
soraiayugulis merged 9 commits into
mainfrom
feature/repository-layer
Jun 12, 2026
Merged

Feature/repository layer#5
soraiayugulis merged 9 commits into
mainfrom
feature/repository-layer

Conversation

@soraiayugulis

Copy link
Copy Markdown
Owner

Summary

Implements the repository layer with interfaces in the application layer and thread-safe in-memory implementations in the infrastructure layer, following hexagonal architecture.

Changes

Interfaces (application/repository)

  • CardRepository — save, findById, findByNumber, update, delete
  • MerchantRepository — save, findById, update
  • TransactionRepository — save, findById, findByCardId

Implementations (infrastructure/repository)

  • InMemoryCardRepository — ConcurrentHashMap-backed, supports lookup by id and card number
  • InMemoryMerchantRepository — ConcurrentHashMap-backed
  • InMemoryTransactionRepository — ConcurrentHashMap-backed with:
    • Chronological ordering by createdAt
    • 90-day retention filter (excludes transactions older than 90 days)

Tests

  • 76 unit tests — all passing
  • Covers: CRUD operations, lookup by different keys, updates, deletes, empty results, chronological ordering

Architecture

  • Interfaces in application layer (domain-agnostic contracts)
  • Implementations in infrastructure layer
  • Thread-safe via ConcurrentHashMap
  • Ready for future swap to database-backed implementations

@soraiayugulis soraiayugulis self-assigned this Jun 12, 2026
@soraiayugulis soraiayugulis merged commit 0120f28 into main Jun 12, 2026
2 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