Skip to content

Conversation

@twlite
Copy link
Contributor

@twlite twlite commented Dec 20, 2025

Description

This PR updates promotion-service to exclude seller orders when counting promotion usage. Fixes #3042

Breaking changes

N/A

Screenshots

N/A

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

@vercel
Copy link

vercel bot commented Dec 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview Jan 22, 2026 8:43am
vendure-storybook Ready Ready Preview, Comment Jan 22, 2026 8:43am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Walkthrough

Updated promotion-service queries to exclude Seller-type orders when counting promotion usages. Two methods—countPromotionUsagesForCustomer and countPromotionUsages—now filter out orders that are inactive and not of OrderType.Seller; an import of OrderType was added.

Changes

Cohort / File(s) Change Summary
Promotion service update
packages/core/src/service/services/promotion.service.ts
Added import of OrderType and updated countPromotionUsagesForCustomer and countPromotionUsages query builders to exclude orders where order.active = false and order.type != OrderType.Seller.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description includes a clear summary linked to issue #3042, notes no breaking changes, and the checklist reflects completion of core requirements.
Linked Issues check ✅ Passed The code changes directly address issue #3042 by excluding Seller-type orders from promotion usage counts in both required query builders.
Out of Scope Changes check ✅ Passed All changes are focused on the specific objective of excluding seller orders from promotion usage counting; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title accurately summarizes the main change: excluding seller orders when counting promotion usage, which directly addresses the issue of incorrect promotion usage counting for split orders.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e235d85 and 61c9362.

📒 Files selected for processing (1)
  • packages/core/src/service/services/promotion.service.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: e2e tests (20.x, mariadb)
  • GitHub Check: e2e tests (20.x, postgres)
  • GitHub Check: e2e tests (24.x, postgres)
  • GitHub Check: e2e tests (20.x, sqljs)
  • GitHub Check: e2e tests (24.x, mariadb)
  • GitHub Check: e2e tests (24.x, sqljs)
  • GitHub Check: build (24.x)
  • GitHub Check: unit tests (24.x)
  • GitHub Check: unit tests (20.x)
  • GitHub Check: build (22.x)
  • GitHub Check: build (20.x)
  • GitHub Check: publish_install (macos-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 20.x)
  • GitHub Check: publish_install (macos-latest, 24.x)
  • GitHub Check: publish_install (macos-latest, 20.x)
  • GitHub Check: publish_install (windows-latest, 22.x)
  • GitHub Check: publish_install (ubuntu-latest, 24.x)
  • GitHub Check: publish_install (windows-latest, 24.x)

@twlite twlite changed the title Fix(core): exclude seller orders when counting promotion usage fix(core): Exclude seller orders when counting promotion usage Dec 20, 2025
@sonarqubecloud
Copy link

@twlite
Copy link
Contributor Author

twlite commented Jan 30, 2026

@dlhck anything preventing this from being merged?

@dlhck
Copy link
Collaborator

dlhck commented Jan 30, 2026

@twlite will be reviewed soon.

@dlhck dlhck requested a review from michaelbromley January 30, 2026 12:47
@michaelbromley michaelbromley merged commit fe72cdb into vendurehq:master Jan 30, 2026
28 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
@twlite twlite deleted the patch-2 branch January 30, 2026 13:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect promotion usage count for split orders

3 participants