Files
tiku-backend.net/Tiku.Api/Contracts/PlatformApprovalDtos.cs
xiong c497a3ca8d
Some checks failed
ci / release-gate (push) Has been cancelled
清理代码
2026-08-03 12:31:39 +08:00

27 lines
831 B
C#

using System.ComponentModel.DataAnnotations;
using System.Text.Json;
using Tiku.Application.PlatformAdmin;
using Tiku.Domain.Common;
namespace Tiku.Api.Contracts;
public sealed record PlatformApprovalDecisionDto([Required] [MaxLength(1000)] string Reason);
public sealed record UpdatePlatformApprovalPolicyDto(
bool Enabled,
bool AlwaysRequireApproval,
[Range(1, int.MaxValue)] int? AmountThresholdCents,
[Range(1, 720)] int ExpiresAfterHours,
JsonElement? Conditions)
{
public UpdatePlatformApprovalPolicyCommand ToCommand(string code)
{
return new UpdatePlatformApprovalPolicyCommand(
code,
Enabled,
AlwaysRequireApproval,
AmountThresholdCents,
ExpiresAfterHours,
Conditions?.Clone() ?? JsonDefaults.Object());
}
}