export type LicenseEdition = 'local' | 'cloud';

export interface LicensePayload {
  licenseId: string;
  customerId: string;
  customerName: string;
  edition: LicenseEdition;
  maxUsers: number;
  features: string[];
  issuedAt: string;   // ISO date string
  expiresAt: string;  // ISO date string
  machineHash: string | null; // null for cloud edition
  tenantId: string | null;    // null for local edition
}

export interface LicenseValidationResult {
  valid: boolean;
  payload?: LicensePayload;
  error?: string;
  /** Remaining days until expiry */
  daysRemaining?: number;
}

export interface StoredLicense {
  key: string;
  activatedAt: string;
  lastCheckedAt?: string;
  payload: LicensePayload;
}
