修改相关bug
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
namespace SimpleAdmin.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 签署材料模板版本的时间有效性规则。
|
||||
/// </summary>
|
||||
internal static class ContractTemplateVersionValidity
|
||||
{
|
||||
internal static void ValidateRange(DateTime? effectiveAt, DateTime? expiresAt)
|
||||
{
|
||||
if (effectiveAt.HasValue && expiresAt.HasValue && expiresAt.Value <= effectiveAt.Value)
|
||||
throw Oops.Bah("失效时间必须晚于生效时间");
|
||||
}
|
||||
|
||||
internal static bool IsAvailable(ObContractTemplateVersion version, DateTime now)
|
||||
{
|
||||
return version != null
|
||||
&& version.VersionStatus == ContractTemplateVersionStatus.Enabled
|
||||
&& (!version.EffectiveDate.HasValue || version.EffectiveDate.Value <= now)
|
||||
&& (!version.ExpiryDate.HasValue || version.ExpiryDate.Value > now);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user