2023-12-11 17:59:14 +01:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
// SPDX-FileCopyrightText: 2023 swt23w23
|
2023-12-07 16:58:29 +01:00
|
|
|
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);
|
|
|
|
|
|
|
|
}
|