test(platform-orders): 批量生效动作补充 refund_status 口径测试护栏
This commit is contained in:
@@ -22,7 +22,7 @@ class AdminPlatformOrderBatchMarkActivatedFilterFieldsTest extends TestCase
|
||||
])->assertRedirect('/admin');
|
||||
}
|
||||
|
||||
public function test_batch_mark_activated_filtered_scope_respects_receipt_status_and_reconcile_mismatch_filters(): void
|
||||
public function test_batch_mark_activated_filtered_scope_respects_receipt_status_refund_status_and_reconcile_mismatch_filters(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
@@ -81,20 +81,48 @@ class AdminPlatformOrderBatchMarkActivatedFilterFieldsTest extends TestCase
|
||||
],
|
||||
]);
|
||||
|
||||
// 批量生效:过滤条件=已支付+待处理 + 无回执 + 对账不一致,只应推进 A
|
||||
// C:有退款(refund_summary=1)+ 无回执 + 对账不一致(回执总额0,但 paid_amount=10)
|
||||
// 如果不加 refund_status=none 的筛选,会被误推进;这里用测试保证“退款筛选口径”能影响批量动作
|
||||
$c = PlatformOrder::query()->create([
|
||||
'merchant_id' => $merchant->id,
|
||||
'plan_id' => $plan->id,
|
||||
'order_no' => 'PO_BMA_FILTER_C',
|
||||
'order_type' => 'new_purchase',
|
||||
'status' => 'pending',
|
||||
'payment_status' => 'paid',
|
||||
'plan_name' => $plan->name,
|
||||
'billing_cycle' => $plan->billing_cycle,
|
||||
'period_months' => 1,
|
||||
'quantity' => 1,
|
||||
'payable_amount' => 10,
|
||||
'paid_amount' => 10,
|
||||
'placed_at' => now(),
|
||||
'paid_at' => now(),
|
||||
'meta' => [
|
||||
'refund_summary' => [
|
||||
'count' => 1,
|
||||
'total_amount' => 1.00,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
// 批量生效:过滤条件=已支付+待处理 + 无回执 + 无退款 + 对账不一致,只应推进 A
|
||||
$this->post('/admin/platform-orders/batch-mark-activated', [
|
||||
'scope' => 'filtered',
|
||||
'payment_status' => 'paid',
|
||||
'status' => 'pending',
|
||||
'receipt_status' => 'none',
|
||||
'refund_status' => 'none',
|
||||
'reconcile_mismatch' => '1',
|
||||
'limit' => 50,
|
||||
])->assertRedirect();
|
||||
|
||||
$a->refresh();
|
||||
$b->refresh();
|
||||
$c->refresh();
|
||||
|
||||
$this->assertSame('activated', $a->status);
|
||||
$this->assertSame('pending', $b->status);
|
||||
$this->assertSame('pending', $c->status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user