Expose active temp card state on room responses
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
This commit is contained in:
@@ -33,4 +33,17 @@ interface IssuedCardRepo : JpaRepository<IssuedCard, UUID> {
|
||||
@org.springframework.data.repository.query.Param("roomStayId") roomStayId: UUID,
|
||||
@org.springframework.data.repository.query.Param("now") now: java.time.OffsetDateTime
|
||||
): Boolean
|
||||
|
||||
@org.springframework.data.jpa.repository.Query("""
|
||||
select c
|
||||
from IssuedCard c
|
||||
where c.property.id = :propertyId
|
||||
and c.roomStay is null
|
||||
and c.revokedAt is null
|
||||
and c.expiresAt > :now
|
||||
""")
|
||||
fun findActiveTempCardsForProperty(
|
||||
@org.springframework.data.repository.query.Param("propertyId") propertyId: UUID,
|
||||
@org.springframework.data.repository.query.Param("now") now: java.time.OffsetDateTime
|
||||
): List<IssuedCard>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user