| 22352 |
ashik.ali |
1 |
package com.spice.profitmandi.dao.repository.user;
|
|
|
2 |
|
| 36376 |
aman |
3 |
import java.util.List;
|
|
|
4 |
|
| 22352 |
ashik.ali |
5 |
import org.springframework.stereotype.Repository;
|
|
|
6 |
|
|
|
7 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 36376 |
aman |
8 |
import com.spice.profitmandi.dao.cart.v2.CartLifecycleStatus;
|
|
|
9 |
import com.spice.profitmandi.dao.cart.v2.SaleType;
|
| 22352 |
ashik.ali |
10 |
import com.spice.profitmandi.dao.entity.user.Cart;
|
|
|
11 |
|
|
|
12 |
@Repository
|
|
|
13 |
public interface CartRepository {
|
|
|
14 |
public void persist(Cart cart);
|
|
|
15 |
public Cart selectById(int id) throws ProfitMandiBusinessException;
|
| 36376 |
aman |
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Authorization-aware lookup: returns the cart only if it belongs to the
|
|
|
19 |
* given retailer AND matches the expected sale type. Used by
|
|
|
20 |
* V2BillingController so one partner cannot touch another partner's draft.
|
|
|
21 |
*/
|
|
|
22 |
public Cart findByIdAndRetailerAndSaleType(int id, int retailerId, SaleType saleType);
|
|
|
23 |
|
|
|
24 |
/**
|
|
|
25 |
* All open tertiary drafts for a partner (most recent first). Procurement
|
|
|
26 |
* carts and closed tertiary carts are excluded.
|
|
|
27 |
*/
|
|
|
28 |
public List<Cart> findActiveDraftsByRetailer(int retailerId, SaleType saleType, CartLifecycleStatus status);
|
| 22352 |
ashik.ali |
29 |
}
|