feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.
This commit is contained in:
@@ -5,22 +5,38 @@ namespace App\Http\Controllers\Api\Service;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\Api\Service\ServiceListResource;
|
||||
use App\Http\Resources\Api\Service\ServiceResource;
|
||||
use App\Http\Services\Invoice\InvoiceService;
|
||||
use App\Jobs\VirtualMachine\ProcessOrderPaymentJob;
|
||||
use App\Models\Addon;
|
||||
use App\Models\Cart;
|
||||
use App\Models\CartAddon;
|
||||
use App\Models\Discount;
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderAddon;
|
||||
use App\Models\OrderItem;
|
||||
use App\Models\Product;
|
||||
use App\Models\ProductPricings;
|
||||
use App\Repositories\Api\Service\ServiceRepository;
|
||||
use App\Services\Api\Service\ServiceService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class ServiceController extends Controller
|
||||
{
|
||||
protected $serviceService;
|
||||
protected $serviceRepository;
|
||||
|
||||
public function __construct(ServiceService $serviceService)
|
||||
public function __construct(
|
||||
ServiceService $serviceService,
|
||||
ServiceRepository $serviceRepository
|
||||
)
|
||||
{
|
||||
$this->serviceService = $serviceService;
|
||||
$this->serviceRepository = $serviceRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lấy danh sách dịch vụ (sản phẩm) đang hoạt động
|
||||
*/
|
||||
public function getService(Request $request)
|
||||
{
|
||||
$limit = $request->get('limit', 10);
|
||||
@@ -35,7 +51,12 @@ class ServiceController extends Controller
|
||||
|
||||
public function getDetailService(Product $product)
|
||||
{
|
||||
$product->load(['osVersions.osGroup', 'category', 'pricings' => fn ($q) => $q->where('is_active', 1)]);
|
||||
$product->load([
|
||||
'osVersions.osGroup',
|
||||
'category',
|
||||
'pricings' => fn($q) => $q->where('is_active', 1),
|
||||
'addons'
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
|
||||
Reference in New Issue
Block a user