Files
FootwearTest-20260602/Footwear Test methodsfor wholeshoe Slipresistanceperformance/Models/LicenseModels.cs
2026-06-15 10:28:16 +08:00

43 lines
1.0 KiB
C#

using System;
namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Models
{
public enum LicenseStage
{
FirstPeriod,
SecondPeriod,
Permanent
}
public enum LicenseCheckState
{
NotInitialized,
Valid,
Expired,
Tampered
}
public sealed record PasswordSecret(string Salt, string Hash);
public sealed record LicenseData(
string InstallId,
LicenseStage Stage,
DateTime StageStartedUtc,
DateTime LastTrustedUtc,
int FirstPeriodMonths,
int SecondPeriodMonths,
PasswordSecret AdminPassword,
PasswordSecret FirstUnlockPassword,
PasswordSecret SecondUnlockPassword);
public sealed record LicenseCheckResult(
LicenseCheckState State,
LicenseStage Stage,
DateTime? ExpiresUtc,
string Message)
{
public bool CanUseSoftware => State == LicenseCheckState.Valid;
public bool RequiresUnlock => State == LicenseCheckState.Expired;
}
}