Skip to content

fix(stock-counter): exclude soft-deleted product variants from resolveVariant queries - #1729

Open
Pratyush-Panda-2006 wants to merge 1 commit into
AnthropicBots:mainfrom
Pratyush-Panda-2006:fix/stock-counter-soft-deleted-variants
Open

fix(stock-counter): exclude soft-deleted product variants from resolveVariant queries#1729
Pratyush-Panda-2006 wants to merge 1 commit into
AnthropicBots:mainfrom
Pratyush-Panda-2006:fix/stock-counter-soft-deleted-variants

Conversation

@Pratyush-Panda-2006

Copy link
Copy Markdown
Contributor

Description

Fixes matching and stock deduction on soft-deleted product variants in \�ackend/services/stockCounterService.js. Previously,
esolveVariant\ checked \is_active = 1\ but omitted \deleted_at IS NULL, creating a discrepancy with \getVariantRollup\ and allowing deleted variants to be resolved and sold during checkout.

Related Issue

Closes #1724

Clean Architecture & Changes

  • Added \AND deleted_at IS NULL\ to both explicit variant ID and attribute-based variant lookup queries in
    esolveVariant().
  • Added unit tests in \�ackend/tests/stockCounterDeletedVariant.test.js\ verifying soft-deleted variant exclusion.

Verification

  • Run
    px jest tests/stockCounterDeletedVariant.test.js\ (All unit tests passing cleanly).

@hydra-maintainer

Copy link
Copy Markdown

🔍 Quality Gate Report

✅ All quality gates passed!

Status Check Details
Linked Issue PR description references a closing issue ✅

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Pratyush-Panda-2006 is attempting to deploy a commit to the Bhuvansh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@hydra-maintainer

Copy link
Copy Markdown

🤖 AI Code Review

🔴 Score: 50/100 | comment

AI review unavailable at this time.


Automated AI review — a human maintainer will also review.

@hydra-maintainer

Copy link
Copy Markdown

💡 Suggested reviewers based on relevant file history: @Aditya8369, @MOHITKOURAV01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Soft-Deleted Product Variants Matched and Deducted in Variant Stock Resolver

1 participant