Fix backend test gates and department product access
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ if (!class_exists('FakeEconomicV2BookedDepartment75VersioningService')) {
|
||||
return $this->subscriptionVersions;
|
||||
}
|
||||
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp): ?array
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp, ?int $department_id = null): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ if (!class_exists('FakeEconomicV2DistributionVersioningService')) {
|
||||
return $this->subscriptionVersions;
|
||||
}
|
||||
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp): ?array
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp, ?int $department_id = null): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ if (!class_exists('TestableEconomicV2DistributionService')) {
|
||||
return 100.0;
|
||||
}
|
||||
|
||||
protected function resolveDiscountForProduct(int $customer_number, int $product_id, string $timestamp): ?array
|
||||
protected function resolveDiscountForProduct(int $customer_number, int $product_id, string $timestamp, ?int $department_id = null): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ if (!class_exists('EconomicV2DistributionServiceOrderOverrideVersioningDouble'))
|
||||
return [];
|
||||
}
|
||||
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp): ?array
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp, ?int $department_id = null): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
+16
-1
@@ -23,7 +23,7 @@ if (!class_exists('FakeEconomicV2ProductFixedPriceVersioningService')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp): ?array
|
||||
public function resolveDiscountOverrideAt(int $customer_number, bool $is_category, string|int $object_id, string $timestamp, ?int $department_id = null): ?array
|
||||
{
|
||||
if (!$is_category && (int)$object_id === 42) {
|
||||
return [
|
||||
@@ -99,6 +99,21 @@ if (!class_exists('TestableEconomicV2ProductFixedPriceDistributionService')) {
|
||||
return 1000.0;
|
||||
}
|
||||
|
||||
protected function resolveDiscountForProduct(int $customer_number, int $product_id, string $timestamp, ?int $department_id = null): ?array
|
||||
{
|
||||
if ($product_id !== 42) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return [
|
||||
'customer_number' => $customer_number,
|
||||
'is_category' => 0,
|
||||
'object_id' => '42',
|
||||
'discount' => 10,
|
||||
'fixed_price' => 350,
|
||||
];
|
||||
}
|
||||
|
||||
protected function isOrderEligible(array $order): bool
|
||||
{
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -41,5 +41,5 @@ it('anchors historical resolution on order created_at timestamps in distribution
|
||||
expect($content)->not->toBeFalse();
|
||||
expect($content)->toContain('resolveFixedPricingVersionAt($customer_number, $created_at)');
|
||||
expect($content)->toContain('resolveVehicleSubscriptionVersionsAt($customer_number, $created_at)');
|
||||
expect($content)->toContain('resolveDiscountForProduct($customer_number, $product_id, $created_at)');
|
||||
expect($content)->toContain('resolveDiscountForProduct($customer_number, $product_id, $created_at, $department_id)');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user