Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
36376 aman 1
package com.spice.profitmandi.dao.cart.v2;
2
 
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
4
 
5
public interface CartHydrationService {
6
 
7
	/**
8
	 * Loads the cart from the DB and batch-fetches live price, inventory,
9
	 * tax, Solr content, scheme cashback, and affiliate validation in one pass.
10
	 * Target: at most 8 downstream calls regardless of cart size.
11
	 *
12
	 * Pincode is derived from the cart's bound address ({@code cart.addressId}),
13
	 * not accepted from the client. If no address is bound yet, serviceability
14
	 * fields are left unset and the client is expected to bind one before checkout.
15
	 *
16
	 * @param storeId the fofo/retailer id that scopes inventory + scheme cashback
17
	 *                (from UserInfo.getRetailerId())
18
	 * Does NOT mutate the cart or emit warnings — pure read.
19
	 */
20
	/**
21
	 * Stock source is chosen from {@code cart.sale_type} on the persisted Cart row:
22
	 *   PARTNER_PROCUREMENT → cross-warehouse availability from SaholicInventorySnapshot;
23
	 *   TERTIARY_SALE       → partner's own in-store stock from CurrentInventorySnapshot.
24
	 */
25
	HydratedCart hydrate(int cartId, int storeId) throws ProfitMandiBusinessException;
26
}