feat(inventory): add InventorySubject enum and integrate into catalog item management

This commit is contained in:
2026-08-12 14:42:30 -03:00
parent 5b089e71b2
commit 8e94cf7856
13 changed files with 280 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Domains\Catalog\Models;
use App\Domains\Attachable\Models\Attachment;
use App\Domains\Catalog\Enums\CatalogItemType;
use App\Domains\Catalog\Enums\InventoryPolicy;
use App\Domains\Catalog\Enums\InventorySubject;
use App\Domains\Catalog\Services\CatalogInventoryService;
use App\Domains\Tenant\Models\Tenant;
use App\Domains\Ticket\Enums\TicketGenerationPolicy;
@@ -30,6 +31,7 @@ use Illuminate\Support\Collection;
'descripcion',
'precio',
'inventory_policy',
'inventory_subject',
'max_units_per_user',
'has_tickets',
'ticket_generation_policy',
@@ -46,6 +48,7 @@ class CatalogItem extends Model
protected $attributes = [
'type' => CatalogItemType::Standard->value,
'inventory_policy' => InventoryPolicy::Tracked->value,
'inventory_subject' => InventorySubject::Product->value,
'has_tickets' => false,
'ticket_generation_policy' => TicketGenerationPolicy::PerEventDate->value,
];
@@ -59,6 +62,7 @@ class CatalogItem extends Model
'type' => CatalogItemType::class,
'precio' => 'decimal:2',
'inventory_policy' => InventoryPolicy::class,
'inventory_subject' => InventorySubject::class,
'max_units_per_user' => 'integer',
'has_tickets' => 'boolean',
'ticket_generation_policy' => TicketGenerationPolicy::class,
@@ -208,6 +212,11 @@ class CatalogItem extends Model
return $this->nombre;
}
public function getSelectionLabel(): string
{
return $this->getName();
}
public function getDescription(): ?string
{
return $this->descripcion;