Consolidate duplicate send-card error translations into messages.error.cannot_send_card
This commit is contained in:
@@ -52,11 +52,11 @@ class UserService implements UserServiceInterface
|
|||||||
$lockedSender = User::where('id', $sender->id)->lockForUpdate()->first();
|
$lockedSender = User::where('id', $sender->id)->lockForUpdate()->first();
|
||||||
|
|
||||||
if ($lockedSender->flag_send == config('constants.FLAG_SEND_DISABLED')) {
|
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) {
|
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
|
// Lock & check total sent cards to the receiver this month
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ return [
|
|||||||
'thank_card_send_success' => 'Đã gửi Thank card thành công!',
|
'thank_card_send_success' => 'Đã gửi Thank card thành công!',
|
||||||
|
|
||||||
'error' => [
|
'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ợ.",
|
'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ợ.",
|
||||||
'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ợ.",
|
|
||||||
'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.',
|
'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.',
|
'receiver_invalid' => 'Người nhận không tồn tại hoặc đã nghỉ việc.',
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user