swt23w23/src/main/java/catering/order/CustomOrderRepository.java
Simon Bruder bac025fd0a
Make project REUSE compliant
This finally makes the licensing under AGPL-3.0-or-later explicit after
I got the okay from the kickstart source owners.

This also checks the REUSE compliance in a pre commit hook, and
therefore also in CI.
2023-12-11 17:59:14 +01:00

27 lines
867 B
Java

// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-FileCopyrightText: 2023 swt23w23
package catering.order;
import catering.catalog.Rentable;
import org.salespointframework.inventory.UniqueInventory;
import org.salespointframework.inventory.UniqueInventoryItem;
import org.salespointframework.order.Order;
import org.salespointframework.quantity.Quantity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.util.Streamable;
import org.springframework.data.repository.Repository;
import java.time.LocalDateTime;
public interface CustomOrderRepository extends Repository<CustomOrder, Order.OrderIdentifier>{
@Query("""
select order from #{#entityName} order
where
not order.start > ?2 and
not order.finish < ?1
""")
Streamable<CustomOrder> findOrdersByInterval(LocalDateTime start, LocalDateTime finish);
}