Refactor order payment process and enhance invoice details

- Updated `payOrder` method in `OrderControllerRefactor` to accept `orderNum` instead of `id` for better clarity and functionality.
- Implemented `findByOrderNum` method in `OrderRepository` to retrieve orders based on order number and customer ID.
- Enhanced `InvoiceDetailResource` to include VMware details and removed unnecessary fields.
- Added `service_plan_id` to `ProductResource` and updated the `Product` model to establish a relationship with `ServicePlan`.
- Created `ServicePlan` and `ServicePlanPlesk` models along with their respective controllers and migrations for managing hosting service plans.
- Updated API routes to include endpoints for managing service plans.
- Modified email templates to standardize support phone number across various customer communications.
This commit is contained in:
baodev0
2026-08-11 10:12:25 +07:00
parent e3d3dea8aa
commit 7314313198
26 changed files with 329 additions and 32 deletions
@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('service_plans', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->unsignedInteger('vcpu');
$table->unsignedInteger('ram');
$table->unsignedInteger('disk');
$table->unsignedInteger('domain');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('service_plans');
}
};
@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('service_plan_plesk', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('service_plan_id')->unique();
$table->string('plesk_plan_name');
$table->text('note')->nullable();
$table->timestamps();
$table->foreign('service_plan_id')->references('id')->on('service_plans')->onDelete('cascade');
});
}
public function down(): void
{
Schema::dropIfExists('service_plan_plesk');
}
};
@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('products', function (Blueprint $table) {
$table->unsignedBigInteger('service_plan_id')->nullable()->after('product_categories_id');
$table->foreign('service_plan_id')->references('id')->on('service_plans')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
$table->dropForeign(['service_plan_id']);
$table->dropColumn('service_plan_id');
});
}
};