Commit Graph
5 Commits
Author SHA1 Message Date
objecttothis f299688540 fix(tests): ensure stock location creation in item quantity tests
- Add `ensureStockLocation` method to automatically create missing stock locations during test execution.
- Update `addItemQuantity` to call `ensureStockLocation` before adding item quantity.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-08-21 16:40:12 +04:00
objecttothis 1932251a73 fix(items): enhance named attribute search with improved type handling
- Add support for searching named attributes with decimal and date types.
- Extend parsing logic to handle locale-specific decimal separators.
- Update `applyNamedAttributeSearch` to return consumed names for better compatibility with free-text search.
- Refine regex matching for combined attribute search syntax.
- Expand test coverage for named attribute search across various scenarios.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-08-21 15:41:47 +04:00
objecttothis 55fd835e70 fix(items): implement named attribute search and optimize attribute handling
- This commit harmonizes #4442 with this PR.
- Add `applyNamedAttributeSearch` method to enable searching by named attributes with specific values.
- Refactor `applyAttributeSort` to accept pre-resolved definition info, improving query integrity.
- Enhance free-text search to support combined attribute name:value syntax.
- Add tests for named attribute search and free-text parsing compatibility.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-08-21 14:07:25 +04:00
objecttothis 410c6649e0 refactor(items): streamline tax computation and add tests for getItemDataRow
Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-08-20 21:28:56 +04:00
objecttothis 29a9b1a7e7 Bugfix: Resolve Race Condition in Rewards and Gift Card Spending (#4640)
* Implement atomic updates for gift card and reward point decrements, enhance error handling for insufficient balances, and add regression tests for concurrency safety.

* Add translations for insufficient gift card balance and reward points error messages across all supported languages.

* Reorder `clear_suspended_sale_detail` call to ensure transactional consistency.

* Reorder `clear_all` call to align with success and error handling logic.

* Ensure soft-deleted gift cards are excluded in balance updates.

* Refactor change_quantity logic with atomic upserts, improve error handling for insufficient stock, and update related tests and constants.

* Added check for NEW_ENTRY

* Added unit tests to test changes.

* Fix class name casing in ItemQuantityTest for consistency.

* Fix Bulgarian translations for insufficient balance error messages in Sales module.

* Fix Greek translations for insufficient balance error messages in Sales module.

* Fix Armenian translations for insufficient balance error messages in Sales module.

* Fix Tamil translations for insufficient balance error messages in Sales module.

* Implement race condition testing for database methods with concurrent process support.

* Fix class name casing in ItemTest for consistency.

* Improve concurrent process handling in race condition tests; add readiness and synchronization barriers.

* Improve handling of process I/O streams and timeout management in race condition tests.

* Add test for decrementing gift card value when marked as deleted

* Add `finally` block to ensure proper cleanup in async database race condition tests

* Improve error handling and timeout management in async database race condition tests.

* Refactor test utilities to use shared `EmployeeFixtureTrait` and `ItemFixtureTrait`.

* Track process exit codes explicitly in race condition tests for improved error detection and debugging.

* Improve error handling in `ConcurrentDbRaceTrait` by adding exceptions for `mysqli_poll` and `mysqli_reap_async_query`.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>

---------

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-08-20 02:24:23 +04:00