ui(platform-orders): add more audit action labels
This commit is contained in:
@@ -832,12 +832,13 @@
|
|||||||
'batch_activate_subscription' => '批量同步订阅',
|
'batch_activate_subscription' => '批量同步订阅',
|
||||||
'mark_activated' => '仅标记为已生效',
|
'mark_activated' => '仅标记为已生效',
|
||||||
'batch_mark_activated' => '批量仅标记为已生效',
|
'batch_mark_activated' => '批量仅标记为已生效',
|
||||||
|
'batch_mark_paid_and_activate' => '批量标记支付并生效(BMPA)',
|
||||||
'activate_subscription' => '同步订阅',
|
'activate_subscription' => '同步订阅',
|
||||||
|
'attach_subscription' => '绑定订阅(续费缺订阅治理)',
|
||||||
'mark_refunded' => '手动标记为已退款',
|
'mark_refunded' => '手动标记为已退款',
|
||||||
'mark_partially_refunded' => '手动标记为部分退款',
|
'mark_partially_refunded' => '手动标记为部分退款',
|
||||||
'mark_paid_status' => '手动标记为已支付',
|
'mark_paid_status' => '手动标记为已支付',
|
||||||
'mark_paid_and_activate' => '标记支付并生效(BMPA)',
|
'mark_paid_and_activate' => '标记支付并生效(BMPA)',
|
||||||
'activate_subscription' => '同步订阅',
|
|
||||||
'add_payment_receipt' => '追加支付回执',
|
'add_payment_receipt' => '追加支付回执',
|
||||||
'add_refund_receipt' => '追加退款回执',
|
'add_refund_receipt' => '追加退款回执',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use App\Models\Merchant;
|
||||||
|
use App\Models\Plan;
|
||||||
|
use App\Models\PlatformOrder;
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformOrderShowAuditActionLabelsShouldRenderMoreActionsTest extends TestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabase;
|
||||||
|
|
||||||
|
protected function loginAsPlatformAdmin(): void
|
||||||
|
{
|
||||||
|
$this->seed();
|
||||||
|
|
||||||
|
$this->post('/admin/login', [
|
||||||
|
'email' => 'platform.admin@demo.local',
|
||||||
|
'password' => 'Platform@123456',
|
||||||
|
])->assertRedirect('/admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_show_page_should_render_action_labels_for_batch_bmpa_and_attach_subscription(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$merchant = Merchant::query()->firstOrFail();
|
||||||
|
$plan = Plan::query()->create([
|
||||||
|
'code' => 'audit_action_labels_more_plan',
|
||||||
|
'name' => '审计动作名补齐测试套餐',
|
||||||
|
'billing_cycle' => 'monthly',
|
||||||
|
'price' => 30,
|
||||||
|
'list_price' => 30,
|
||||||
|
'status' => 'active',
|
||||||
|
'sort' => 10,
|
||||||
|
'published_at' => now(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$order = PlatformOrder::query()->create([
|
||||||
|
'merchant_id' => $merchant->id,
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'order_no' => 'PO_AUDIT_ACTION_LABELS_MORE_0001',
|
||||||
|
'order_type' => 'renewal',
|
||||||
|
'status' => 'pending',
|
||||||
|
'payment_status' => 'unpaid',
|
||||||
|
'plan_name' => $plan->name,
|
||||||
|
'billing_cycle' => $plan->billing_cycle,
|
||||||
|
'period_months' => 1,
|
||||||
|
'quantity' => 1,
|
||||||
|
'payable_amount' => 30,
|
||||||
|
'paid_amount' => 0,
|
||||||
|
'placed_at' => now(),
|
||||||
|
'meta' => [
|
||||||
|
'audit' => [
|
||||||
|
[
|
||||||
|
'action' => 'attach_subscription',
|
||||||
|
'scope' => 'single',
|
||||||
|
'at' => now()->toDateTimeString(),
|
||||||
|
'admin_id' => 1,
|
||||||
|
'subscription_id' => 123,
|
||||||
|
'note' => '测试',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'action' => 'batch_mark_paid_and_activate',
|
||||||
|
'scope' => 'filtered',
|
||||||
|
'at' => now()->toDateTimeString(),
|
||||||
|
'admin_id' => 1,
|
||||||
|
'note' => '测试',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->get('/admin/platform-orders/' . $order->id)
|
||||||
|
->assertOk()
|
||||||
|
->assertSee('绑定订阅(续费缺订阅治理)')
|
||||||
|
->assertSee('批量标记支付并生效(BMPA)');
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user