feat: 新增赔率版本和玩法配置版本的删除接口,支持删除草稿版本

This commit is contained in:
2026-05-15 15:30:40 +08:00
parent 5398af0a55
commit c0cd8be0fb
18 changed files with 574 additions and 125 deletions

View File

@@ -131,6 +131,26 @@ final class RiskCapStreamService
);
}
public function deleteVersion(RiskCapVersion $version, AdminUser $admin, ?Request $request = null): void
{
$before = $this->snapshotVersion($version);
DB::transaction(function () use ($version): void {
$version->delete();
});
AuditLogger::recordForAdmin(
$admin,
$request,
moduleCode: 'risk_cap',
actionCode: 'delete',
targetType: 'risk_cap_version',
targetId: (string) $version->id,
beforeJson: $before,
afterJson: null,
);
}
/** @return array<string, mixed> */
private function snapshotVersion(RiskCapVersion $v): array
{