Subversion Repositories SmartDukaan

Rev

Rev 35947 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.repository.user;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
import com.spice.profitmandi.dao.cart.v2.CartLifecycleStatus;
import com.spice.profitmandi.dao.cart.v2.SaleType;
import com.spice.profitmandi.dao.entity.user.Cart;

@Repository
public interface CartRepository {
        public void persist(Cart cart);
        public Cart selectById(int id) throws ProfitMandiBusinessException;

        /**
         * Authorization-aware lookup: returns the cart only if it belongs to the
         * given retailer AND matches the expected sale type. Used by
         * V2BillingController so one partner cannot touch another partner's draft.
         */
        public Cart findByIdAndRetailerAndSaleType(int id, int retailerId, SaleType saleType);

        /**
         * All open tertiary drafts for a partner (most recent first). Procurement
         * carts and closed tertiary carts are excluded.
         */
        public List<Cart> findActiveDraftsByRetailer(int retailerId, SaleType saleType, CartLifecycleStatus status);
}