From 5158703a3e921566b28cecab7d88aa4bcd2230dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 12:27:57 +0800 Subject: [PATCH] ui(platform-orders): add more audit action labels --- .../admin/platform_orders/show.blade.php | 3 +- ...ctionLabelsShouldRenderMoreActionsTest.php | 81 +++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderShowAuditActionLabelsShouldRenderMoreActionsTest.php diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index badec77..048f7f6 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -832,12 +832,13 @@ 'batch_activate_subscription' => '批量同步订阅', 'mark_activated' => '仅标记为已生效', 'batch_mark_activated' => '批量仅标记为已生效', + 'batch_mark_paid_and_activate' => '批量标记支付并生效(BMPA)', 'activate_subscription' => '同步订阅', + 'attach_subscription' => '绑定订阅(续费缺订阅治理)', 'mark_refunded' => '手动标记为已退款', 'mark_partially_refunded' => '手动标记为部分退款', 'mark_paid_status' => '手动标记为已支付', 'mark_paid_and_activate' => '标记支付并生效(BMPA)', - 'activate_subscription' => '同步订阅', 'add_payment_receipt' => '追加支付回执', 'add_refund_receipt' => '追加退款回执', ]; diff --git a/tests/Feature/AdminPlatformOrderShowAuditActionLabelsShouldRenderMoreActionsTest.php b/tests/Feature/AdminPlatformOrderShowAuditActionLabelsShouldRenderMoreActionsTest.php new file mode 100644 index 0000000..d87811b --- /dev/null +++ b/tests/Feature/AdminPlatformOrderShowAuditActionLabelsShouldRenderMoreActionsTest.php @@ -0,0 +1,81 @@ +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)'); + } +}