feat: 增强票据与钱包服务的幂等性及错误处理能力

在 TicketItemShowController 与 TicketItemsIndexController 的响应中新增订单状态与失败原因字段。
更新 WalletLogsController:待对账列表支持按币种筛选。
在 TicketPlacementService 中引入幂等性校验,支持处理已退款订单的重复请求。
优化钱包相关操作的错误码与错误提示信息,提升问题定位与用户理解。
增强测试用例,验证票据下单流程中的新幂等性行为。
This commit is contained in:
2026-05-26 15:24:54 +08:00
parent c8c90e3e94
commit 36e50383ba
12 changed files with 154 additions and 23 deletions

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Exceptions;
use App\Models\TicketOrder;
use RuntimeException;
/** 事务内发现同 trace 订单已存在,交由 {@see TicketPlacementService} 做幂等回放。 */
final class IdempotentTicketReplayException extends RuntimeException
{
public function __construct(
public readonly TicketOrder $order,
) {
parent::__construct('idempotent_ticket_replay');
}
}