feat: 新增赔率版本和玩法配置版本的删除接口,支持删除草稿版本
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user