Stabilize custom pricing API fixture
This commit is contained in:
@@ -1710,6 +1710,17 @@ final class ApiFixtures
|
||||
$this->cleanup->add(fn() => $this->deleteWhere($table, $conditions));
|
||||
}
|
||||
|
||||
public function cacheEconomicCustomerDiscountPercentage(int $userId, int $discountPercentage): void
|
||||
{
|
||||
if ($this->redis === null) {
|
||||
throw new RuntimeException('API tests require Redis for cache-backed endpoint flows.');
|
||||
}
|
||||
|
||||
$key = 'users_' . $userId . '_economic_customer_discount_percentage';
|
||||
$this->redis->set($key, (string)$discountPercentage);
|
||||
$this->cleanup->add(fn() => $this->deleteRedisKey($key));
|
||||
}
|
||||
|
||||
private function purgeCustomerTraceData(int $userId, int $customerNumber): void
|
||||
{
|
||||
$invoiceCollectionIds = $this->fetchIntColumnWhere('collected_order_invoices', 'id', [
|
||||
|
||||
Reference in New Issue
Block a user