Interface BasketInvoicesRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<BasketInvoiceEntity,Long>, DomainIdRepository<BasketInvoiceEntity,Long>, org.springframework.data.jpa.repository.JpaRepository<BasketInvoiceEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<BasketInvoiceEntity>, org.springframework.data.repository.ListCrudRepository<BasketInvoiceEntity,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<BasketInvoiceEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<BasketInvoiceEntity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<BasketInvoiceEntity>, org.springframework.data.repository.Repository<BasketInvoiceEntity,Long>

@Repository public interface BasketInvoicesRepository extends DomainIdRepository<BasketInvoiceEntity,Long>
Provides domain-scoped persistence and statistical queries for basket invoices.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T extends Object>
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.data.domain.Page<BasketInvoiceEntity>
    findAllByLoggedUserIdAndDomainId(Integer loggedUserId, Integer domainId, org.springframework.data.domain.Pageable pageable)
     
     
    findAllForStatistics(Integer domainId, Date dateFrom, Date dateTo, boolean filterByStatus, List<Integer> statusIds)
    Finds invoice values for the selected reporting interval and optional statuses.
    getStatusId(Long id, Integer domainId)
     

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface sk.iway.iwcm.system.datatable.spring.DomainIdRepository

    findAllByDomainId, findAllByDomainId, findAllByIdInAndDomainId, findFirstByIdAndDomainId

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    count, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, update

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findAllByLoggedUserIdAndDomainId

      org.springframework.data.domain.Page<BasketInvoiceEntity> findAllByLoggedUserIdAndDomainId(Integer loggedUserId, Integer domainId, org.springframework.data.domain.Pageable pageable)
    • findAllByLoggedUserIdAndDomainIdOrderByCreateDateDesc

      List<BasketInvoiceEntity> findAllByLoggedUserIdAndDomainIdOrderByCreateDateDesc(Integer loggedUserId, Integer domainId)
    • getStatusId

      @Query("SELECT bie.statusId FROM BasketInvoiceEntity bie WHERE bie.id = :id AND bie.domainId = :domainId") Integer getStatusId(@Param("id") Long id, @Param("domainId") Integer domainId)
    • findAllForStatistics

      @Query("SELECT bie.createDate AS createDate,\n bie.statusId AS statusId,\n bie.deliveryMethod AS deliveryMethod,\n bie.paymentMethod AS paymentMethod,\n bie.priceToPayVat AS priceToPayVat,\n bie.priceToPayNoVat AS priceToPayNoVat,\n bie.currency AS currency\nFROM BasketInvoiceEntity bie\nWHERE bie.domainId = :domainId\n AND bie.createDate >= :dateFrom\n AND bie.createDate <= :dateTo\n AND (:filterByStatus = false OR bie.statusId IN :statusIds)\nORDER BY bie.createDate ASC\n") List<BasketInvoiceStatsProjection> findAllForStatistics(@Param("domainId") Integer domainId, @Param("dateFrom") Date dateFrom, @Param("dateTo") Date dateTo, @Param("filterByStatus") boolean filterByStatus, @Param("statusIds") List<Integer> statusIds)
      Finds invoice values for the selected reporting interval and optional statuses.
      Parameters:
      domainId - domain whose invoices are included
      dateFrom - inclusive start of the reporting interval
      dateTo - inclusive end of the reporting interval
      filterByStatus - whether to restrict invoices to statusIds
      statusIds - invoice statuses included when filtering is enabled
      Returns:
      matching invoices ordered by creation date