From 041ea8fe7788d45107441ec939c096507cde1c20 Mon Sep 17 00:00:00 2001 From: antv Date: Wed, 15 Jul 2026 22:43:16 +0700 Subject: [PATCH] Consolidate duplicate send-card error translations into messages.error.cannot_send_card --- app/Services/User/UserService.php | 4 ++-- lang/vi/messages.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Services/User/UserService.php b/app/Services/User/UserService.php index 4eec54e..a2ecf26 100644 --- a/app/Services/User/UserService.php +++ b/app/Services/User/UserService.php @@ -52,11 +52,11 @@ class UserService implements UserServiceInterface $lockedSender = User::where('id', $sender->id)->lockForUpdate()->first(); if ($lockedSender->flag_send == config('constants.FLAG_SEND_DISABLED')) { - throw new \App\Exceptions\ThankCardException(__('messages.error.no_send_permission')); + throw new \App\Exceptions\ThankCardException(__('messages.error.cannot_send_card')); } if ($lockedSender->card < $amount) { - throw new \App\Exceptions\ThankCardException(__('messages.error.not_enough_cards')); + throw new \App\Exceptions\ThankCardException(__('messages.error.cannot_send_card')); } // Lock & check total sent cards to the receiver this month diff --git a/lang/vi/messages.php b/lang/vi/messages.php index c48ec45..38c274d 100644 --- a/lang/vi/messages.php +++ b/lang/vi/messages.php @@ -9,8 +9,7 @@ return [ 'thank_card_send_success' => 'Đã gửi Thank card thành công!', 'error' => [ - 'no_send_permission' => "Bạn không thể gửi Thank Card.\nCó thể bạn đã sử dụng hết số lượng Thank Card hoặc chưa được cấp quyền gửi. Vui lòng liên hệ Admin để được hỗ trợ.", - 'not_enough_cards' => "Bạn không thể gửi Thank Card.\nCó thể bạn đã sử dụng hết số lượng Thank Card hoặc chưa được cấp quyền gửi. Vui lòng liên hệ Admin để được hỗ trợ.", + 'cannot_send_card' => "Bạn không thể gửi Thank Card.\nCó thể bạn đã sử dụng hết số lượng Thank Card hoặc chưa được cấp quyền gửi. Vui lòng liên hệ Admin để được hỗ trợ.", 'max_send_limit_template' => 'Một tháng bạn chỉ được gửi tối đa :max card cho một người. Bạn đã gửi :sent card cho nhân viên này.', 'receiver_invalid' => 'Người nhận không tồn tại hoặc đã nghỉ việc.', ]