Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.cart.v2;

import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;

public interface CartHydrationService {

        /**
         * Loads the cart from the DB and batch-fetches live price, inventory,
         * tax, Solr content, scheme cashback, and affiliate validation in one pass.
         * Target: at most 8 downstream calls regardless of cart size.
         *
         * Pincode is derived from the cart's bound address ({@code cart.addressId}),
         * not accepted from the client. If no address is bound yet, serviceability
         * fields are left unset and the client is expected to bind one before checkout.
         *
         * @param storeId the fofo/retailer id that scopes inventory + scheme cashback
         *                (from UserInfo.getRetailerId())
         * Does NOT mutate the cart or emit warnings — pure read.
         */
        /**
         * Stock source is chosen from {@code cart.sale_type} on the persisted Cart row:
         *   PARTNER_PROCUREMENT → cross-warehouse availability from SaholicInventorySnapshot;
         *   TERTIARY_SALE       → partner's own in-store stock from CurrentInventorySnapshot.
         */
        HydratedCart hydrate(int cartId, int storeId) throws ProfitMandiBusinessException;
}