The backend business logic is encapsulated in the VisitedCountryService
, which serves as the central service responsible for for all operations related to visited countries. It ensures transactional consistency, delegates persistence to the repository layer, and logs key actions for traceability.
src/main/kotlin/
└── ghdrope/beenthere/backend/service/
└── VisitedCountryService.kt
The service layer is responsible for:
fun findAll(): List<VisitedCountry>
Returns the full list of visited countries stored in the database.
fun saveAll(countries: List<VisitedCountry>): List<VisitedCountry>
Persists a list of new visited countries. Useful for bulk insertion.
fun deleteByCodes(codes: List<String>)