|
|
@@ -214,7 +214,7 @@ class RewardPointRepository extends Repository
|
|
|
|
|
|
if (!$customerPoints) {
|
|
|
Log::warning('Customer points record not found', ['customer_id' => $customerId]);
|
|
|
- return false;
|
|
|
+ throw new \Exception('Customer points record not found');
|
|
|
}
|
|
|
|
|
|
if ($customerPoints->mw_reward_point < $amount) {
|
|
|
@@ -223,7 +223,7 @@ class RewardPointRepository extends Repository
|
|
|
'current' => $customerPoints->mw_reward_point,
|
|
|
'required' => $amount
|
|
|
]);
|
|
|
- return false;
|
|
|
+ throw new \Exception('Insufficient points');
|
|
|
}
|
|
|
|
|
|
$currentBalance = (int) $customerPoints->mw_reward_point;
|
|
|
@@ -264,7 +264,7 @@ class RewardPointRepository extends Repository
|
|
|
'amount' => $amount,
|
|
|
'error' => $e->getMessage()
|
|
|
]);
|
|
|
- return false;
|
|
|
+ throw $e;
|
|
|
}
|
|
|
}
|
|
|
public function getHistory($customerId, $limit = 20, $page = null)
|