| Rev |
Age |
Author |
Path |
Log message |
Diff |
| 37792 |
7 d 22 h |
amit |
/trunk/profitmandi-dao/src/ |
feat(cart): carry bag at Rs 1 per smartphone over Rs 12,000, extras at listing price
One carry bag (item 32046) is priced at Rs 1 for each smartphone (category
10006) in the cart selling above Rs 12,000; bags beyond that count are priced
at the carry bag's listing price, and Bronze partners pay listing for all.
Closes the leak where bag-only carts of hundreds of bags at Rs 1 were placed
from the old app. CarryBagQuote (via CartService.getCarryBagQuote) is the
single rule; the cart carries it as one line at a blended price.
- CartService/CartServiceImpl, CartResponse, OpenCartValidationResult: expose
the quote on the cart.
- OrderLineAllocator: an item may now have more than one cart line (the flat
and listing-priced parts); its units fill the lines in order.
- TransactionServiceImpl: item quantities merge instead of failing on a
duplicate item id.
- PurchaseServiceImpl: partner GRN creates one stock record per billed price;
the GRN screen shows the blended unit price; dead
createScannedNonSerializedItem removed.
- PurchaseReturnServiceImpl: debit-note PDF picks the order billed at the
returned stock's price; refundOrder spreads a non-serialized return over the
item's orders with room left (same price first) instead of loading it all
on the first order.
Tests: CarryBagQuoteTest 6/6, OrderLineAllocatorTest 13/13.
Deploy with profitmandi-web (same change) and the partner apps. |
|
| 37706 |
18 d 9 h |
amit |
/trunk/ |
cart: take the cart row before any line, to break a lock-ordering deadlock
InnoDB was rolling back cart edits with "Deadlock found when trying to get lock"
(GlitchTip #53, 27 deadlocks) and losing others to OptimisticLockException
"actual row count: 0; expected: 1" (11 issues, 42 events). Both are the same cause.
Two request paths took the same two rows in OPPOSITE orders. Adding a line INSERTs
into user.line, and line_cart_id_fk shared-locks the parent cart FIRST, line second.
Validation/hydration mutated the line rows FIRST and wrote cart.total_price second.
Run those concurrently on one cart and it is a cycle. Caught in the act on prod:
T1: INSERT user.line (cart_id=175180781) -> holds S on cart, waits S on line
T2: UPDATE user.cart SET total_price=269340.0, version=175 WHERE version=174
-> holds X on line, waits X on cart
*** WE ROLL BACK TRANSACTION (1)
Fix is to give every mutating path one order: cart, then lines. CartRepository gains
selectByIdForUpdate, and it is called as the first statement of each path that writes
a cart line. Re-taking it inside one request is a no-op.
A lock-ordering fix is all-or-nothing -- one path in the wrong order is enough to
re-form the cycle -- so this covers ALL TEN cart-line writers, not just the two that
happened to show up in the stack traces: createCartItem, clearCart, getCartValidation,
addItemsToCart (x2), addShoppingBag, validateForOpen (x2) and V2BillingController's
bind/unbindInsurance. The audit is worth re-running before adding another writer.
Note validateForOpen and getCartValidation WRITE despite their names (they correct
cart_line quantity/price and roll up cart.total_price), which is why a "validate" call
was ever holding write locks. The lock is placed accordingly; making those genuinely
read-only is a separate, larger change.
This also serialises concurrent edits to the SAME cart, which is what the @Version
column on Cart was already trying and failing to express. Different carts are
different rows, so there is no cost across partners. |
|
| 37640 |
20 d 20 h |
amit |
/trunk/profitmandi-dao/src/ |
Hot Deal brand: brand-driven membership, model_hot_deal reduced to attributes + oem_brand + oem_catalog_id, migration SQL |
|
| 37305 |
53 d 20 h |
ranu |
/trunk/ |
carry bag for silver at 1 |
|
| 37283 |
56 d 21 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ |
hot deals: cart/pricing availability reads date-windowed model_hot_deal instead of tag_listing.hot_deals |
|
| 37143 |
73 d 20 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ |
Brand eligibility: unified blocked + LOI-ineligible enforcement — new BlockedBrandService; BrandsService restrictedBrands/applyRestrictedSolrExclusion/validateOrderableBrands; hard-validate at add-to-cart (fofoId-aware addItemsToCart) and bulk order; cart validation uses restricted union |
|
| 35947 |
214 d 0 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ |
Revert r35945: undo cart pessimistic locking (will re-apply after testing) |
|
| 35945 |
214 d 2 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ |
Add pessimistic locking to cart operations to prevent deadlocks; add updateCartItem, removeCartItem, getCartItems methods |
|
| 35690 |
239 d 6 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ |
Optimize order creation performance: add overloaded focusedModelShortageValidation with pre-fetched data, add overloaded payThroughWallet and processTransaction to avoid duplicate fetches, fix N+1 queries in BulkOrderService by batch-fetching items and tagListings |
|
| 35574 |
260 d 11 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
Fix price mismatch false positives in cart validation
- Handle cart price = 0/unset: silently update to current price (client bug)
- Use tolerance comparison (0.01) instead of exact Float.compare
- Prevents false PRICE_CHANGED errors from float precision issues |
|
| 35573 |
260 d 12 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
Feature: Add price mismatch detection in cart
- Detect when cart item price differs from current TagListing price
- Notify user with PRICE_CHANGED message showing old vs new price
- Auto-update cart line with current price
- Add logging for price mismatch events |
|
| 35493 |
285 d 14 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ |
N+1 query optimization for B2B order creation flow
- OrderServiceImpl: Batch fetch PendingOrderItems before validation loop (line 402)
- OrderServiceImpl: Batch update opening stock using minusOpeningStockBatch
- OrderServiceImpl: Pre-fetch tagListings and GST rates before createAndGetFofoOrderItem loop
- OrderServiceImpl: Batch fetch PendingOrderItems for status update (line 719)
- CartServiceImpl: Pre-fetch items before getCartValidation loop
- SchemeServiceImpl: Batch fetch SchemeInOut records in processSchemeOut
- SmartCartService: Added minusOpeningStockBatch method for batch updates
- TagListingRepository: Added selectByItemIds batch method
- FofoOpeningStockRepository: Added findByFofoIdAndCatalogIds batch method
- PendingOrderItemRepository: Added selectByIds batch method
Performance improvement: ~70-100 DB queries reduced per order (10 items avg) |
|
| 35214 |
354 d 19 h |
vikas |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
App build Version & Notification Template |
|
| 35211 |
355 d 18 h |
vikas |
/trunk/ |
App build Version & Notification Template |
|
| 35170 |
360 d 18 h |
vikas |
/trunk/ |
Carry bag 1 rupee to NEW, GOLD, PLATINUM, DIAMOND |
|
| 35140 |
363 d 22 h |
ranu |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
in transit add in instock |
|
| 33244 |
899 d 0 h |
ranu |
/trunk/ |
add signature added profitmandi exception |
|
| 33172 |
919 d 21 h |
tejus.lohani |
/trunk/ |
add bulk order service in admin dashboard |
|
| 32588 |
1070 d 19 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
Fixed cart |
|
| 32585 |
1070 d 23 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
Changed quantity to 400 |
|
| 32493 |
1103 d 0 h |
amit.gupta |
/trunk/ |
Added changes related to auto order creation when internal po is created |
|
| 31792 |
1278 d 23 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ |
Fixed Item qty bug |
|
| 31783 |
1279 d 18 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
Fixed net availability to SaholicCIS Table |
|
| 31781 |
1279 d 20 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
Fixed net availability to SaholicCIS Table |
|
| 31773 |
1281 d 17 h |
amit.gupta |
/trunk/ |
Fixed net availability to SaholicCIS Table |
|
| 31326 |
1386 d 17 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ |
Fixed Availablity logic |
|
| 30836 |
1509 d 19 h |
tejbeer |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
change |
|
| 29497 |
1804 d 0 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ |
|
|
| 29404 |
1823 d 15 h |
tejbeer |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
|
|
| 29327 |
1832 d 2 h |
tejbeer |
/trunk/ |
change |
|
| 29261 |
1842 d 16 h |
amit.gupta |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ |
|
|
| 28653 |
1904 d 1 h |
amit.gupta |
/trunk/ |
Added Changes to order creation |
|
| 28170 |
2008 d 1 h |
tejbeer |
/trunk/ |
|
|
| 28166 |
2008 d 20 h |
tejbeer |
/trunk/ |
chnage |
|
| 26522 |
2370 d 19 h |
amit.gupta |
/trunk/ |
|
|