-open refund function for all admin (ignore whether the booking has invoice or not)

-when refund is before the whiteform, auto approve the transaction
This commit is contained in:
JiaSheng
2024-04-29 21:19:34 +08:00
parent 20cb00ed24
commit 7655853a6d
3 changed files with 16 additions and 5 deletions
@@ -86,8 +86,8 @@ class UpdateRefundTransactionStatusLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
if (!(Auth::user()->type === 0 || Auth::user()->type === 1)) {
throw new MalformedRequestException('Only super admin can update refund status.');
if(auth()->user()->type === 3) {
throw new MalformedRequestException('You do not have the permission to refund the order.');
}
$refundTransaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]);