Skip to content

Add off budget and on budget rule logic#185

Merged
bvanelli merged 5 commits into
bvanelli:mainfrom
JaxOfDiamonds:add_off_budget_rule_logic
Mar 7, 2026
Merged

Add off budget and on budget rule logic#185
bvanelli merged 5 commits into
bvanelli:mainfrom
JaxOfDiamonds:add_off_budget_rule_logic

Conversation

@JaxOfDiamonds
Copy link
Copy Markdown
Contributor

@JaxOfDiamonds JaxOfDiamonds commented Mar 3, 2026

Summary

Updated logic so rules can handle the offBudget and onBudget account condition. The exact condition is used in the test case.

Motivation

offBudget and onBudget account rule was failing.

Server source code

Excerpt from line 403 of condition.ts:

      case 'onBudget':
        if (!object._account) {
          return false;
        }

        return object._account.offbudget === 0;

      case 'offBudget':
        if (!object._account) {
          return false;
        }

        return object._account.offbudget === 1;

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.95%. Comparing base (cb6eb96) to head (3261921).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #185   +/-   ##
=======================================
  Coverage   97.94%   97.95%           
=======================================
  Files          21       21           
  Lines        3117     3128   +11     
=======================================
+ Hits         3053     3064   +11     
  Misses         64       64           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bvanelli
Copy link
Copy Markdown
Owner

bvanelli commented Mar 3, 2026

Nice, could you additionally link the relevant code snipped from this rule on the original source code?

@JaxOfDiamonds JaxOfDiamonds changed the title Add off budget rule logic Add off budget and on budget rule logic Mar 6, 2026
@JaxOfDiamonds
Copy link
Copy Markdown
Contributor Author

Added onBudget logic as well.

@bvanelli
Copy link
Copy Markdown
Owner

bvanelli commented Mar 7, 2026

Thank you for the contribution @JaxOfDiamonds , I did just a small refactor to simplify the import.

@bvanelli bvanelli merged commit c436117 into bvanelli:main Mar 7, 2026
9 checks passed
@JaxOfDiamonds JaxOfDiamonds deleted the add_off_budget_rule_logic branch March 8, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants