feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.

This commit is contained in:
pbao9
2026-02-11 17:02:07 +07:00
parent 58a9aa685b
commit 556b2c02e6
47 changed files with 1367 additions and 497 deletions
@@ -8,7 +8,7 @@ use App\Http\Requests\Product\ProductRequest;
use App\Http\Services\ProductService;
use App\Repositories\Group\GroupRepositoryInterface;
use App\Repositories\Admin\Product\ProductRepositoryInterface;
use App\Repositories\Type\TypeRepositoryInterface;
use Illuminate\Http\Request;
use Yajra\DataTables\Facades\DataTables;
use Exception;
@@ -16,7 +16,6 @@ use Exception;
class ProductController extends Controller
{
public function __construct(
public TypeRepositoryInterface $typeRepository,
public GroupRepositoryInterface $groupRepository,
public ProductRepositoryInterface $productRepository,
public ProductService $productService
@@ -31,7 +30,7 @@ class ProductController extends Controller
'page' => $request->get('page') ?? 1
]
);
$title = "List All Product";
return view('administrator.pages.product.index', compact('title', 'products'));
@@ -43,7 +42,7 @@ class ProductController extends Controller
$title = 'Add new product';
// Fetch Product Categories instead of generic groups
$group = \App\Models\ProductCategories::where('is_active', \App\Enums\Status::ACTIVE->value)->get();
$type = $this->typeRepository->getAll();
$type = null;
// Fetch OS versions with their group for the OS selector component
$osVersions = \App\Models\Os::with('osGroup')->where('status', 1)->get();
@@ -93,7 +92,7 @@ class ProductController extends Controller
$title = 'Edit product: ' . $product->name;
$group = \App\Models\ProductCategories::where('is_active', \App\Enums\Status::ACTIVE->value)->get();
$type = $this->typeRepository->getAll();
$type = null;
// Fetch OS versions for select
$osVersions = \App\Models\Os::with('osGroup')->where('status', 1)->get();