mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-24 11:47:24 +02:00
54 lines
1.6 KiB
Text
54 lines
1.6 KiB
Text
enum LicenseType {
|
|
PLUS
|
|
ORGANIZATION
|
|
ENTERPRISE
|
|
}
|
|
|
|
enum LicenseStatus {
|
|
ACTIVE
|
|
REVOKED
|
|
}
|
|
|
|
model License {
|
|
id String @id @default(cuid())
|
|
licenseKey String @unique @map("license_key")
|
|
version Int? @map("version")
|
|
type LicenseType
|
|
seats Int? @map("seats")
|
|
issuedAt DateTime @default(now()) @map("issued_at")
|
|
expiresAt DateTime? @map("expires_at")
|
|
licenseeEmail String? @map("licensee_email")
|
|
licenseeName String? @map("licensee_name")
|
|
status LicenseStatus @default(ACTIVE) @map("status")
|
|
|
|
validations LicenseValidation[]
|
|
|
|
@@map("licenses")
|
|
}
|
|
|
|
model LicenseValidation {
|
|
id String @id @default(cuid())
|
|
licenseId String @map("license_id")
|
|
license License @relation(fields: [licenseId], references: [id], onDelete: Cascade)
|
|
ipAddress String? @map("ip_address")
|
|
fingerprint String? @map("fingerprint")
|
|
validatedAt DateTime @default(now()) @map("validated_at")
|
|
userAgent String? @map("user_agent")
|
|
|
|
@@map("license_validations")
|
|
}
|
|
|
|
model InstanceLicense {
|
|
id String @id @default(cuid())
|
|
licenseKey String @unique @map("license_key")
|
|
version Int? @map("version")
|
|
type LicenseType
|
|
seats Int? @map("seats")
|
|
issuedAt DateTime @default(now()) @map("issued_at")
|
|
expiresAt DateTime? @map("expires_at")
|
|
licenseeEmail String? @map("licensee_email")
|
|
licenseeName String? @map("licensee_name")
|
|
status LicenseStatus @default(ACTIVE) @map("status")
|
|
|
|
@@map("instance_licenses")
|
|
}
|