Merge branch 'refactor/inventory_stock' of https://gitea.quo.ar/tbianchini/shopit-back into refactor/inventory_stock

This commit is contained in:
2026-09-29 08:23:09 -03:00
parent c5aeb19735
commit 96378a6c2e
596 changed files with 239 additions and 7622 deletions

View File

@@ -2,16 +2,16 @@
namespace App\Shared\Notification\Services;
use App\Domains\Commerce\Purchase\Models\Purchase;
use App\Domains\Core\Auth\Models\ResetPasswordAttempt;
use App\Domains\Core\Auth\Models\User;
use App\Shared\Integration\Services\MailService;
use App\Shared\Notification\Events\PasswordResetRequested;
use App\Domains\Commerce\Purchase\Models\Purchase;
use App\Domains\Core\Tenant\Models\Tenant;
use App\Domains\Ticketing\Ticket\Models\Ticket;
use App\Domains\Ticketing\Ticket\Services\TicketPdfService;
use App\Domains\Ticketing\Ticket\Services\TicketPresentationResolver;
use App\Domains\Ticketing\Ticket\Services\TicketValidityResolver;
use App\Shared\Integration\Services\MailService;
use App\Shared\Notification\Events\PasswordResetRequested;
use Closure;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
@@ -158,7 +158,7 @@ class NotificationMailService
$context = ['purchase_id' => $purchaseId];
$purchase = Purchase::query()
->with(['event', 'tenant', 'user', 'items'])
->with(['tenant', 'user', 'items'])
->find($purchaseId);
if ($purchase === null) {
@@ -197,7 +197,8 @@ class NotificationMailService
'mime' => 'application/pdf',
]];
$this->mailForPurchase($purchase)
$this->mailService
->forTenant($purchase->tenant_codigo)
->send(
$recipient,
"Compra confirmada - Compra #{$purchase->getKey()}",
@@ -285,6 +286,7 @@ class NotificationMailService
$context,
$recipient,
function () use (
$tenantCode,
$purchase,
$recipient,
$previousDate,
@@ -293,7 +295,8 @@ class NotificationMailService
): array {
$brand = $purchase->tenant;
$this->mailForPurchase($purchase)
$this->mailService
->forTenant($tenantCode)
->send(
$recipient,
"Tu evento fue reprogramado - N° de Orden #{$purchase->getKey()}",
@@ -384,6 +387,7 @@ class NotificationMailService
$context,
$recipient,
function () use (
$tenantCode,
$purchase,
$recipient,
$date,
@@ -392,7 +396,8 @@ class NotificationMailService
): array {
$brand = $purchase->tenant;
$this->mailForPurchase($purchase)
$this->mailService
->forTenant($tenantCode)
->send(
$recipient,
"Una fecha de tu evento fue suspendida - N° de Orden #{$purchase->getKey()}",
@@ -416,17 +421,10 @@ class NotificationMailService
{
return Purchase::query()
->where('tenant_codigo', $tenantCode)
->with(['event', 'tenant', 'user'])
->with(['tenant', 'user'])
->find($purchaseId);
}
private function mailForPurchase(Purchase $purchase): MailService
{
return $purchase->event
? $this->mailService->forEvent($purchase->event)
: $this->mailService->forTenant($purchase->tenant_codigo);
}
private function recipientFor(Purchase $purchase): string
{
return (string) ($purchase->email ?: $purchase->user?->email);