package org.octopus.internal.db

import org.octopus.internal.common.enums.EEntryType
import org.octopus.internal.db.entities.EntryEntity
import org.springframework.data.jpa.repository.JpaRepository
import java.time.Month
import java.util.Date

interface EntryJpa : JpaRepository<EntryEntity, Long> {
    fun findAllByType(type: EEntryType): MutableList<EntryEntity>
    fun findAllByFixedDateIsNullAndRecurrentIsTrueAndEndDateIsNotNullAndEndDateLessThanEqual(endDate: Date): MutableList<EntryEntity>
    fun findAllByFixedDateIsNullAndRecurrentIsTrueAndRecurrentMonthsIn(months: List<Month>): MutableList<EntryEntity>
    fun findAllByFixedDateIsNotNullAndFixedDateLessThanEqual(fixedDate: Date): MutableList<EntryEntity>
}