feat: add idempotency support for settlement adjustments and payments, fix rebate handling
- Added idempotency_key parameter to settlement bill adjustment and payment endpoints to prevent duplicate operations - Fixed player rebate profile updates to preserve existing values when only one field is modified - Moved wallet player validation earlier in AdminPlayerStoreController to prevent unnecessary processing - Enhanced extra rebate calculation to include 'in_bill' and 'settled' statuses in AgentP
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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('payment_records', function (Blueprint $table): void {
|
||||
$table->string('idempotency_key', 64)->nullable()->after('remark');
|
||||
$table->index(['settlement_bill_id', 'idempotency_key']);
|
||||
});
|
||||
|
||||
Schema::table('settlement_adjustments', function (Blueprint $table): void {
|
||||
$table->string('idempotency_key', 64)->nullable()->after('reason');
|
||||
$table->index(['original_bill_id', 'idempotency_key']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('payment_records', function (Blueprint $table): void {
|
||||
$table->dropIndex(['settlement_bill_id', 'idempotency_key']);
|
||||
$table->dropColumn('idempotency_key');
|
||||
});
|
||||
|
||||
Schema::table('settlement_adjustments', function (Blueprint $table): void {
|
||||
$table->dropIndex(['original_bill_id', 'idempotency_key']);
|
||||
$table->dropColumn('idempotency_key');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user