-
Notifications
You must be signed in to change notification settings - Fork 56
Add exact ratio distribution for deterministic test data generation #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
layoutd
wants to merge
53
commits into
trunk
Choose a base branch
from
exact-ratio-distribution
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
161c802
Add --coupon-ratio parameter to order generator
layoutd df0fda0
Add --refund-ratio parameter to order generator
layoutd 4d3eb9d
Improve refund logic to properly handle line items and fees
layoutd 4dd4a96
Fix refund tax calculation to properly handle tax rate IDs
layoutd 84a81bc
Calculate explicit refund amount from line items
layoutd 368e5b7
Fix refund ratio logic and add multiple refund support
layoutd 479a1a8
Update partial refund reason to show products and items
layoutd 4f98a67
Force partial refunds for orders with existing refunds
layoutd a3e1536
Recalculate order totals after applying coupon
layoutd 74ae8e1
Update includes/Generator/Order.php
layoutd e2494ec
Doc update
layoutd ff277e2
Fix array_rand edge case for orders with exactly 2 items
layoutd f80b01e
Refactor coupon creation to use Coupon::generate()
layoutd ee9ff32
Move coupon retrieval logic to Coupon::get_random()
layoutd 07daacb
Use WordPress get_posts() API instead of raw SQL queries
layoutd 57daab8
Add discount_type parameter to Coupon generator
layoutd 24b2493
Refactor Order generator to use Coupon::batch()
layoutd f8d718c
Add discount_type parameter to CLI coupon command
layoutd 080ee99
Update README with new coupon and order parameters
layoutd b9c85f9
Clarify that refunds are split evenly between partial and full
layoutd 86a499c
Fix backwards compatibility: only set discount_type when explicitly p…
layoutd 2c9940e
Add input validation for coupon-ratio and refund-ratio parameters
layoutd 5b53925
Add performance comment for get_posts() in Coupon::get_random()
layoutd 0816747
Clarify that --coupons flag is equivalent to --coupon-ratio=1.0
layoutd 0f5dd77
Fix ratio probability calculation using integer-based random generation
layoutd f69d126
Add check to prevent refunds with empty line items
layoutd 73cdb1b
Improve refund error handling and logging
layoutd ae9b6a6
Add validation to prevent refunds with invalid amounts
layoutd ac5f820
Fix refund amount validation to prevent exceeding order total
layoutd 0b3faa5
Fix refund amount calculations to prevent rounding errors and ensure …
layoutd 9894e7e
Fix partial refunds to track already-refunded quantities and prevent …
layoutd c6d22b4
Fix code quality issues in refund calculations
layoutd 323a1a7
Add realistic date handling for refunds
layoutd 5734f42
Refactor refund generation: extract constants and helper methods
layoutd f08714c
Make default 'fixed_cart' Coupon generator explicit
layoutd 20f415b
Clarify memory impact
layoutd 553d847
Clarify that decimal ratios for coupons and refunds are converted to …
layoutd e17884b
Add error logging for order generation and coupon application failures
layoutd 36d534e
Add exact ratio distribution for deterministic coupon and refund gene…
layoutd 09da72f
Use integer constants instead of strings for refund types
layoutd dc91322
Fix refund type randomness to respect explicit full/partial flags
layoutd 6e143d9
PHPCS
layoutd b91c278
Simplification
layoutd 9d62477
Extract refund distribution ratios as named constants
layoutd 201d302
Replace array_shift with index counters to prevent state mutation
layoutd db93ab6
Remove unnecessary (bool) casts from wp_rand calls
layoutd a033f04
Use floor() instead of round() to avoid double rounding in refund dis…
layoutd da23c52
Simplify status check in init_ratio_flags using null coalescing
layoutd 91f6f06
Add batch size threshold constant for memory management
layoutd eeed7d5
Implement threshold-based fallback for large batch operations
layoutd f699246
Add documentation and user notification for memory-based fallback
layoutd 65ba0a0
Add explicit bounds checking and error logging for batch index arrays
layoutd a02ee68
Merge remote-tracking branch 'origin/trunk' into exact-ratio-distribu…
layoutd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.