Reorganize repo structure and standards references

This commit is contained in:
david committed 2026-06-29 05:03:42 +02:00
1 parent 3cb93a81be
commit be2054274d
5885 files changed
+2588 -195

No files matched your search

@@ -0,0 +1,82 @@
# ORM Decision Record
Date: 2026-05-05
Status: Adopt Prisma 7; evaluate Drizzle later only as a separate ORM migration.
## Context
The project currently uses:
- `prisma`: `7.8.0`
- `@prisma/client`: `7.8.0`
- `@prisma/adapter-pg`: `7.8.0`
- Root-level Prisma schema and migrations via `prisma/`.
- `packages/db` as the database ownership package for generated-client imports and database command entrypoints.
The monorepo, API, worker and database package boundaries are still settling. Changing ORM at the same time would mix a structural migration with a persistence-layer migration and make regressions harder to isolate.
## Decision
Keep Prisma during the current architecture split and upgrade it to Prisma 7 in-place.
This means:
- Do not migrate to Drizzle during package-boundary work.
- Use the Prisma 7 generated TypeScript client entrypoints owned by `packages/db` at `packages/db/generated/prisma/client`.
- Route generate, migrate deploy, seed, build and typecheck through the `@toolctrl/db` package boundary while preserving the existing root Prisma schema and migrations.
- Treat any future Drizzle migration as a later, isolated decision with its own migration plan and verification.
## Revisit Triggers
Reopen this decision after the following are true:
- `packages/db` owns the generated database client boundary.
- Web, API and worker server-side imports use the database package rather than root-local Prisma imports.
- Build, seed, migration and deploy commands have one documented database entrypoint.
- Current Prisma 7 deprecation warnings are captured with exact command output and affected files.
- Query-heavy workflows have at least a basic regression checklist or test coverage.
## Evaluation Criteria
Compare staying on Prisma 7 and moving to Drizzle against the same criteria:
- Migration cost: schema, migrations, seed data, generated types and query call sites.
- Runtime behavior: query count, transaction support, connection behavior and server/worker compatibility.
- Build and deploy impact: client generation, Docker behavior, CI time and production startup.
- Type safety: generated model ergonomics, relation typing and validation boundaries.
- Package ownership: how cleanly the ORM fits inside `packages/db`.
- Operational risk: rollback path, data migration requirements and expected downtime.
- Team ergonomics: local setup, debugging, migrations and query review.
## Options For The Later Phase
### Stay On Prisma 7
Choose Prisma 7 if the current setup remains cheaper to maintain than rewriting the Prisma-heavy query layer.
Required proof:
- Prisma generate, build, seed and migrations work through `pnpm --filter @toolctrl/db ...` package commands.
- Docker and CI run without new ORM-specific warnings.
- Representative API, worker and web database paths pass verification.
### Drizzle
Choose Drizzle if explicit SQL-near queries, smaller runtime surface and package-boundary clarity justify rewriting current Prisma query code and generated-type assumptions.
Required proof:
- A representative domain is migrated end to end.
- Migration and seed conventions are documented.
- Query readability and performance are measurably better or simpler for the chosen domain.
- Rollback to Prisma remains possible until the migration is complete.
- A follow-up deadline or phase is assigned.
- No new code depends on root-local Prisma ownership.
## Non-Goals
- No runtime code change in this documentation foundation.
- No package dependency change.
- No Prisma schema, migration or Docker change.
@@ -0,0 +1,47 @@
# @toolctrl/db
Database ownership package.
This package owns the server-side Prisma client boundary, the generated Prisma TypeScript client, and the repository database command surface while the root schema and migrations remain in their existing locations.
Current ownership:
- Schema: `prisma/schema`
- Migrations: `prisma/migrations`
- Generated client: `packages/db/generated/prisma/client`
- Prisma 7 TypeScript entrypoints: `packages/db/generated/prisma/client/client.ts` and `packages/db/generated/prisma/client/browser.ts`
- Server client API: `@toolctrl/db/client.server`
Use `getDbClient()` from `@toolctrl/db/client.server` for server-side Prisma client creation and development singleton reuse.
Transaction helpers are available from `@toolctrl/db/transactions.server` and the root package export. `runDbTransaction(callback, client?)` wraps interactive Prisma transactions behind an injectable client, while `runDbTransactionBatch(operations, client?)` runs batch operations without forcing app imports.
Seed helpers are available from `@toolctrl/db/seed.server` and the root package export. `runDbSeed({ nodeEnv, adminEmail, adminPassword, seedCredentials, seed, diagnostics })` runs exactly one caller-provided seed callback, rejects production runs that still use local default seed emails or the default `password`, emits `start` / `success` / `failure` diagnostics, and never includes password values in diagnostic events. Use `assertSafeSeedCredentials(options)` when a caller needs to perform the production credential guard separately.
Package scripts delegate to the current root Prisma config while keeping callers on the `@toolctrl/db` package:
- `pnpm --filter @toolctrl/db prisma:generate`
- `pnpm --filter @toolctrl/db prisma:migrate:deploy`
- `pnpm --filter @toolctrl/db seed`
- `pnpm --filter @toolctrl/db permissions:sync`
- `pnpm --filter @toolctrl/db typecheck`
For the non-E2E database CI status gate, see [Database CI runbook](../../docs/db-ci.md). The root `pnpm run verify:db-migrate-status` command checks Prisma migration status through this package boundary and requires a configured `DATABASE_URL` secret.
Root-facing scripts use the same package boundary instead of invoking Prisma or the seed file directly:
- `pnpm run db:generate`
- `pnpm run db:migrate:deploy`
- `pnpm run seed`
- `pnpm run permissions:sync`
- `pnpm run build`
- `pnpm run typecheck`
Planned ownership:
- Migrate app, API and worker database imports to package APIs.
- Keep schema and migrations in `prisma/` until a separate migration explicitly moves those files.
Decision records:
- [ORM Decision Record](./ORM-DECISION.md): preserve Prisma for now; evaluate Prisma 7 vs Drizzle after database package boundaries are stable.
@@ -0,0 +1,932 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file should be your main import to use Prisma-related types and utilities in a browser.
* Use it to get access to models, enums, and input types.
*
* This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
* See `client.ts` for the standard, server-side entry point.
*
* 🟢 You can import this file directly.
*/
import * as Prisma from './internal/prismaNamespaceBrowser.ts'
export { Prisma }
export * as $Enums from './enums.ts'
export * from './enums.ts';
/**
* Model User
*
*/
export type User = Prisma.UserModel
/**
* Model MagicLinkToken
*
*/
export type MagicLinkToken = Prisma.MagicLinkTokenModel
/**
* Model AdminUser
*
*/
export type AdminUser = Prisma.AdminUserModel
/**
* Model Tenant
*
*/
export type Tenant = Prisma.TenantModel
/**
* Model WorkspaceAuthProvider
*
*/
export type WorkspaceAuthProvider = Prisma.WorkspaceAuthProviderModel
/**
* Model ImpersonationAudit
*
*/
export type ImpersonationAudit = Prisma.ImpersonationAuditModel
/**
* Model TenantUser
*
*/
export type TenantUser = Prisma.TenantUserModel
/**
* Model TenantUserInvitation
*
*/
export type TenantUserInvitation = Prisma.TenantUserInvitationModel
/**
* Model Registration
*
*/
export type Registration = Prisma.RegistrationModel
/**
* Model Blacklist
*
*/
export type Blacklist = Prisma.BlacklistModel
/**
* Model TenantIpAddress
*
*/
export type TenantIpAddress = Prisma.TenantIpAddressModel
/**
* Model TenantType
*
*/
export type TenantType = Prisma.TenantTypeModel
/**
* Model Activity
* User-facing business activity timeline (M045 / M01 Block E).
*
* DISTINCT from the tamper-evident, hash-chained `AuditEvent` (M001): `Activity`
* is the per-entity, human-readable stream shown to tenant users (calls, notes,
* emails, status changes, …). Every writing module appends here via
* `logActivity()` from `@hivegrid/activity` (AGENTS DoD #14).
*
* `activityType` and `subjectType` are stored as strings (extensible per module —
* see the `ActivityType` / `ActivitySubjectType` unions in `@hivegrid/activity`),
* not Prisma enums, to avoid a schema migration for every new module event.
*
* Tenant isolation: RLS policy is added with M27 (Auth/Tenancy); until then access
* is App-Level-scoped via the tenant-scoped query helpers.
*/
export type Activity = Prisma.ActivityModel
/**
* Model AnalyticsSettings
*
*/
export type AnalyticsSettings = Prisma.AnalyticsSettingsModel
/**
* Model AnalyticsUniqueVisitor
*
*/
export type AnalyticsUniqueVisitor = Prisma.AnalyticsUniqueVisitorModel
/**
* Model AnalyticsPageView
*
*/
export type AnalyticsPageView = Prisma.AnalyticsPageViewModel
/**
* Model AnalyticsEvent
*
*/
export type AnalyticsEvent = Prisma.AnalyticsEventModel
/**
* Model App
*
*/
export type App = Prisma.AppModel
/**
* Model DataConnection
*
*/
export type DataConnection = Prisma.DataConnectionModel
/**
* Model AppSyncRun
*
*/
export type AppSyncRun = Prisma.AppSyncRunModel
/**
* Model AppSyncRunLog
*
*/
export type AppSyncRunLog = Prisma.AppSyncRunLogModel
/**
* Model AppSyncItem
*
*/
export type AppSyncItem = Prisma.AppSyncItemModel
/**
* Model UserSession
*
*/
export type UserSession = Prisma.UserSessionModel
/**
* Model TrustedDevice
*
*/
export type TrustedDevice = Prisma.TrustedDeviceModel
/**
* Model CollabDoc
*
*/
export type CollabDoc = Prisma.CollabDocModel
/**
* Model AppConfiguration
*
*/
export type AppConfiguration = Prisma.AppConfigurationModel
/**
* Model Log
*
*/
export type Log = Prisma.LogModel
/**
* Model AuditEvent
*
*/
export type AuditEvent = Prisma.AuditEventModel
/**
* Model IdempotencyKey
*
*/
export type IdempotencyKey = Prisma.IdempotencyKeyModel
/**
* Model ApiKey
*
*/
export type ApiKey = Prisma.ApiKeyModel
/**
* Model ApiKeyLog
*
*/
export type ApiKeyLog = Prisma.ApiKeyLogModel
/**
* Model Event
*
*/
export type Event = Prisma.EventModel
/**
* Model EventWebhookAttempt
*
*/
export type EventWebhookAttempt = Prisma.EventWebhookAttemptModel
/**
* Model MetricLog
*
*/
export type MetricLog = Prisma.MetricLogModel
/**
* Model FileUploadProgress
*
*/
export type FileUploadProgress = Prisma.FileUploadProgressModel
/**
* Model FileChunk
*
*/
export type FileChunk = Prisma.FileChunkModel
/**
* Model FileObject
*
*/
export type FileObject = Prisma.FileObjectModel
/**
* Model IpAddress
* Privacy (AD-22): `ip` speichert einen HMAC-SHA256-Pseudonym-Hash der Client-IP, KEINE Klartext-IP.
* Persistiert wird nur das Land (countryCode/countryName); regionCode/city/zipCode/latitude/longitude
* bleiben bewusst leer. Auflösung lokal (DB-IP Lite), kein externer Transfer.
*/
export type IpAddress = Prisma.IpAddressModel
/**
* Model IpAddressLog
* Privacy (AD-22): `ip` ist der HMAC-Pseudonym-Hash der Client-IP, kein Klartext.
*/
export type IpAddressLog = Prisma.IpAddressLogModel
/**
* Model Widget
*
*/
export type Widget = Prisma.WidgetModel
/**
* Model Credential
*
*/
export type Credential = Prisma.CredentialModel
/**
* Model TenantInboundAddress
*
*/
export type TenantInboundAddress = Prisma.TenantInboundAddressModel
/**
* Model Email
*
*/
export type Email = Prisma.EmailModel
/**
* Model EmailRead
*
*/
export type EmailRead = Prisma.EmailReadModel
/**
* Model EmailCc
*
*/
export type EmailCc = Prisma.EmailCcModel
/**
* Model EmailAttachment
*
*/
export type EmailAttachment = Prisma.EmailAttachmentModel
/**
* Model EmailSender
*
*/
export type EmailSender = Prisma.EmailSenderModel
/**
* Model Campaign
*
*/
export type Campaign = Prisma.CampaignModel
/**
* Model OutboundEmail
*
*/
export type OutboundEmail = Prisma.OutboundEmailModel
/**
* Model OutboundEmailOpen
*
*/
export type OutboundEmailOpen = Prisma.OutboundEmailOpenModel
/**
* Model OutboundEmailClick
*
*/
export type OutboundEmailClick = Prisma.OutboundEmailClickModel
/**
* Model EmailSequence
*
*/
export type EmailSequence = Prisma.EmailSequenceModel
/**
* Model EmailSequenceRun
*
*/
export type EmailSequenceRun = Prisma.EmailSequenceRunModel
/**
* Model EmailSequenceStepDelivery
*
*/
export type EmailSequenceStepDelivery = Prisma.EmailSequenceStepDeliveryModel
/**
* Model Entity
*
*/
export type Entity = Prisma.EntityModel
/**
* Model Property
*
*/
export type Property = Prisma.PropertyModel
/**
* Model EntityView
*
*/
export type EntityView = Prisma.EntityViewModel
/**
* Model EntityViewProperty
*
*/
export type EntityViewProperty = Prisma.EntityViewPropertyModel
/**
* Model EntityViewFilter
*
*/
export type EntityViewFilter = Prisma.EntityViewFilterModel
/**
* Model EntityViewSort
*
*/
export type EntityViewSort = Prisma.EntityViewSortModel
/**
* Model PropertyAttribute
*
*/
export type PropertyAttribute = Prisma.PropertyAttributeModel
/**
* Model PropertyOption
*
*/
export type PropertyOption = Prisma.PropertyOptionModel
/**
* Model EntityTag
*
*/
export type EntityTag = Prisma.EntityTagModel
/**
* Model EntityTenantUserPermission
*
*/
export type EntityTenantUserPermission = Prisma.EntityTenantUserPermissionModel
/**
* Model EntityWebhook
*
*/
export type EntityWebhook = Prisma.EntityWebhookModel
/**
* Model EntityWebhookLog
*
*/
export type EntityWebhookLog = Prisma.EntityWebhookLogModel
/**
* Model EntityRelationship
*
*/
export type EntityRelationship = Prisma.EntityRelationshipModel
/**
* Model SampleCustomEntity
*
*/
export type SampleCustomEntity = Prisma.SampleCustomEntityModel
/**
* Model RowRelationship
*
*/
export type RowRelationship = Prisma.RowRelationshipModel
/**
* Model Row
*
*/
export type Row = Prisma.RowModel
/**
* Model RowValue
*
*/
export type RowValue = Prisma.RowValueModel
/**
* Model RowValueMultiple
*
*/
export type RowValueMultiple = Prisma.RowValueMultipleModel
/**
* Model RowValueRange
*
*/
export type RowValueRange = Prisma.RowValueRangeModel
/**
* Model RowPermission
*
*/
export type RowPermission = Prisma.RowPermissionModel
/**
* Model RowMedia
*
*/
export type RowMedia = Prisma.RowMediaModel
/**
* Model RowTag
*
*/
export type RowTag = Prisma.RowTagModel
/**
* Model RowComment
*
*/
export type RowComment = Prisma.RowCommentModel
/**
* Model RowCommentReaction
*
*/
export type RowCommentReaction = Prisma.RowCommentReactionModel
/**
* Model RowTask
*
*/
export type RowTask = Prisma.RowTaskModel
/**
* Model EntityTemplate
*
*/
export type EntityTemplate = Prisma.EntityTemplateModel
/**
* Model EntityGroup
*
*/
export type EntityGroup = Prisma.EntityGroupModel
/**
* Model EntityGroupEntity
*
*/
export type EntityGroupEntity = Prisma.EntityGroupEntityModel
/**
* Model Formula
*
*/
export type Formula = Prisma.FormulaModel
/**
* Model FormulaComponent
*
*/
export type FormulaComponent = Prisma.FormulaComponentModel
/**
* Model FormulaLog
*
*/
export type FormulaLog = Prisma.FormulaLogModel
/**
* Model FormulaComponentLog
*
*/
export type FormulaComponentLog = Prisma.FormulaComponentLogModel
/**
* Model EntityGroupConfiguration
*
*/
export type EntityGroupConfiguration = Prisma.EntityGroupConfigurationModel
/**
* Model EntityGroupConfigurationRow
*
*/
export type EntityGroupConfigurationRow = Prisma.EntityGroupConfigurationRowModel
/**
* Model ApiKeyEntity
*
*/
export type ApiKeyEntity = Prisma.ApiKeyEntityModel
/**
* Model TenantSettingsRow
*
*/
export type TenantSettingsRow = Prisma.TenantSettingsRowModel
/**
* Model EntityLink
* A directed, role-labelled link from one entity to another, scoped per tenant.
* Idempotent on the unique tuple (upsert in entityLinkService).
*/
export type EntityLink = Prisma.EntityLinkModel
/**
* Model FeatureFlag
*
*/
export type FeatureFlag = Prisma.FeatureFlagModel
/**
* Model FeatureFlagFilter
*
*/
export type FeatureFlagFilter = Prisma.FeatureFlagFilterModel
/**
* Model FeatureFlagAudit
* Append-only audit trail for every mutation of a FeatureFlag (create / update / delete / toggle).
* Never UPDATE or DELETE rows from app code — preserves tamper-resistance for compliance.
*/
export type FeatureFlagAudit = Prisma.FeatureFlagAuditModel
/**
* Model File
* A stored file, scoped per tenant. `storageKey` points at the original object
* in the private Hetzner bucket (AD-23); delivery is only via the auth-proxy
* route. Soft-delete via `archivedAt` (archive flag). Hard-delete is a separate
* action (files.delete).
*/
export type File = Prisma.FileModel
/**
* Model FileEntityLink
* Polymorphic link of a file to any entity (cross-cutting). `entityType` +
* `entityId` address the target entity, `linkRole` is an optional role label
* (e.g. "contract", "photo").
*/
export type FileEntityLink = Prisma.FileEntityLinkModel
/**
* Model FileUpload
* Chunked-upload session (replaces spec `FileUploadProgress`, renamed to avoid
* the core collision). No resume in v1 — this session only carries progress up
* to `complete`. `expiresAt` = now + 24h; a cleanup cron sweeps expired
* sessions + temp chunks.
*/
export type FileUpload = Prisma.FileUploadModel
/**
* Model FileUploadChunk
* One uploaded chunk of a `FileUpload` session (replaces spec `FileChunk`).
* Bytes live in temp storage (`storageKey`), not in the DB.
*/
export type FileUploadChunk = Prisma.FileUploadChunkModel
/**
* Model Form
*
*/
export type Form = Prisma.FormModel
/**
* Model FormSubmission
*
*/
export type FormSubmission = Prisma.FormSubmissionModel
/**
* Model Feedback
*
*/
export type Feedback = Prisma.FeedbackModel
/**
* Model SupportTicket
*
*/
export type SupportTicket = Prisma.SupportTicketModel
/**
* Model ImportJob
*
*/
export type ImportJob = Prisma.ImportJobModel
/**
* Model KnowledgeBase
*
*/
export type KnowledgeBase = Prisma.KnowledgeBaseModel
/**
* Model KnowledgeBaseCategory
*
*/
export type KnowledgeBaseCategory = Prisma.KnowledgeBaseCategoryModel
/**
* Model KnowledgeBaseCategorySection
*
*/
export type KnowledgeBaseCategorySection = Prisma.KnowledgeBaseCategorySectionModel
/**
* Model KnowledgeBaseArticle
*
*/
export type KnowledgeBaseArticle = Prisma.KnowledgeBaseArticleModel
/**
* Model KnowledgeBaseRelatedArticle
*
*/
export type KnowledgeBaseRelatedArticle = Prisma.KnowledgeBaseRelatedArticleModel
/**
* Model KnowledgeBaseViews
*
*/
export type KnowledgeBaseViews = Prisma.KnowledgeBaseViewsModel
/**
* Model KnowledgeBaseArticleViews
*
*/
export type KnowledgeBaseArticleViews = Prisma.KnowledgeBaseArticleViewsModel
/**
* Model KnowledgeBaseArticleUpvotes
*
*/
export type KnowledgeBaseArticleUpvotes = Prisma.KnowledgeBaseArticleUpvotesModel
/**
* Model KnowledgeBaseArticleDownvotes
*
*/
export type KnowledgeBaseArticleDownvotes = Prisma.KnowledgeBaseArticleDownvotesModel
/**
* Model Lead
*
*/
export type Lead = Prisma.LeadModel
/**
* Model LeadEvent
*
*/
export type LeadEvent = Prisma.LeadEventModel
/**
* Model TenantAcquisition
*
*/
export type TenantAcquisition = Prisma.TenantAcquisitionModel
/**
* Model MarketingIntegration
*
*/
export type MarketingIntegration = Prisma.MarketingIntegrationModel
/**
* Model NotificationDelivery
*
*/
export type NotificationDelivery = Prisma.NotificationDeliveryModel
/**
* Model UserNotificationPreference
*
*/
export type UserNotificationPreference = Prisma.UserNotificationPreferenceModel
/**
* Model DeviceToken
*
*/
export type DeviceToken = Prisma.DeviceTokenModel
/**
* Model Onboarding
*
*/
export type Onboarding = Prisma.OnboardingModel
/**
* Model OnboardingFilter
*
*/
export type OnboardingFilter = Prisma.OnboardingFilterModel
/**
* Model OnboardingStep
*
*/
export type OnboardingStep = Prisma.OnboardingStepModel
/**
* Model OnboardingSession
*
*/
export type OnboardingSession = Prisma.OnboardingSessionModel
/**
* Model OnboardingSessionAction
*
*/
export type OnboardingSessionAction = Prisma.OnboardingSessionActionModel
/**
* Model OnboardingSessionFilterMatch
*
*/
export type OnboardingSessionFilterMatch = Prisma.OnboardingSessionFilterMatchModel
/**
* Model OnboardingSessionStep
*
*/
export type OnboardingSessionStep = Prisma.OnboardingSessionStepModel
/**
* Model OutboxEvent
*
*/
export type OutboxEvent = Prisma.OutboxEventModel
/**
* Model Role
*
*/
export type Role = Prisma.RoleModel
/**
* Model Permission
*
*/
export type Permission = Prisma.PermissionModel
/**
* Model RolePermission
*
*/
export type RolePermission = Prisma.RolePermissionModel
/**
* Model UserRole
*
*/
export type UserRole = Prisma.UserRoleModel
/**
* Model Group
*
*/
export type Group = Prisma.GroupModel
/**
* Model GroupUser
*
*/
export type GroupUser = Prisma.GroupUserModel
/**
* Model Plugin
*
*/
export type Plugin = Prisma.PluginModel
/**
* Model TenantPluginCapabilityGrant
*
*/
export type TenantPluginCapabilityGrant = Prisma.TenantPluginCapabilityGrantModel
/**
* Model PluginUserConfig
*
*/
export type PluginUserConfig = Prisma.PluginUserConfigModel
/**
* Model PluginInvocation
*
*/
export type PluginInvocation = Prisma.PluginInvocationModel
/**
* Model PluginCapabilityUse
*
*/
export type PluginCapabilityUse = Prisma.PluginCapabilityUseModel
/**
* Model Portal
*
*/
export type Portal = Prisma.PortalModel
/**
* Model PortalUser
*
*/
export type PortalUser = Prisma.PortalUserModel
/**
* Model PortalPage
*
*/
export type PortalPage = Prisma.PortalPageModel
/**
* Model PortalUserRegistration
*
*/
export type PortalUserRegistration = Prisma.PortalUserRegistrationModel
/**
* Model PortalSubscriptionProduct
*
*/
export type PortalSubscriptionProduct = Prisma.PortalSubscriptionProductModel
/**
* Model PortalSubscriptionPrice
*
*/
export type PortalSubscriptionPrice = Prisma.PortalSubscriptionPriceModel
/**
* Model PortalSubscriptionFeature
*
*/
export type PortalSubscriptionFeature = Prisma.PortalSubscriptionFeatureModel
/**
* Model PortalUserSubscription
*
*/
export type PortalUserSubscription = Prisma.PortalUserSubscriptionModel
/**
* Model PortalUserSubscriptionProduct
*
*/
export type PortalUserSubscriptionProduct = Prisma.PortalUserSubscriptionProductModel
/**
* Model PortalUserSubscriptionProductPrice
*
*/
export type PortalUserSubscriptionProductPrice = Prisma.PortalUserSubscriptionProductPriceModel
/**
* Model PortalCheckoutSessionStatus
*
*/
export type PortalCheckoutSessionStatus = Prisma.PortalCheckoutSessionStatusModel
/**
* Model QueueFailedJob
*
*/
export type QueueFailedJob = Prisma.QueueFailedJobModel
/**
* Model ExportJob
*
*/
export type ExportJob = Prisma.ExportJobModel
/**
* Model Site
*
*/
export type Site = Prisma.SiteModel
/**
* Model SubscriptionProduct
*
*/
export type SubscriptionProduct = Prisma.SubscriptionProductModel
/**
* Model SubscriptionPrice
*
*/
export type SubscriptionPrice = Prisma.SubscriptionPriceModel
/**
* Model SubscriptionUsageBasedPrice
*
*/
export type SubscriptionUsageBasedPrice = Prisma.SubscriptionUsageBasedPriceModel
/**
* Model SubscriptionUsageBasedTier
*
*/
export type SubscriptionUsageBasedTier = Prisma.SubscriptionUsageBasedTierModel
/**
* Model SubscriptionFeature
*
*/
export type SubscriptionFeature = Prisma.SubscriptionFeatureModel
/**
* Model TenantSubscription
*
*/
export type TenantSubscription = Prisma.TenantSubscriptionModel
/**
* Model TenantSubscriptionProduct
*
*/
export type TenantSubscriptionProduct = Prisma.TenantSubscriptionProductModel
/**
* Model TenantSubscriptionProductPrice
*
*/
export type TenantSubscriptionProductPrice = Prisma.TenantSubscriptionProductPriceModel
/**
* Model TenantSubscriptionUsageRecord
*
*/
export type TenantSubscriptionUsageRecord = Prisma.TenantSubscriptionUsageRecordModel
/**
* Model TenantProductConfiguration
*
*/
export type TenantProductConfiguration = Prisma.TenantProductConfigurationModel
/**
* Model TenantFeatureOverride
*
*/
export type TenantFeatureOverride = Prisma.TenantFeatureOverrideModel
/**
* Model CheckoutSessionStatus
*
*/
export type CheckoutSessionStatus = Prisma.CheckoutSessionStatusModel
/**
* Model Credit
*
*/
export type Credit = Prisma.CreditModel
/**
* Model Task
* A task, scoped per tenant. Soft-delete via `archivedAt` (archive flag). A
* completed task (`status = done`, `completedAt` set) is auto-archived 30 days
* later by a maintenance cron.
*/
export type Task = Prisma.TaskModel
/**
* Model TaskWatcher
* A user watching a task (M:N). Watchers receive reminder notifications in
* addition to the assignee.
*/
export type TaskWatcher = Prisma.TaskWatcherModel
/**
* Model Workflow
*
*/
export type Workflow = Prisma.WorkflowModel
/**
* Model WorkflowBlock
*
*/
export type WorkflowBlock = Prisma.WorkflowBlockModel
/**
* Model WorkflowBlockConditionGroup
*
*/
export type WorkflowBlockConditionGroup = Prisma.WorkflowBlockConditionGroupModel
/**
* Model WorkflowBlockCondition
*
*/
export type WorkflowBlockCondition = Prisma.WorkflowBlockConditionModel
/**
* Model WorkflowBlockToBlock
*
*/
export type WorkflowBlockToBlock = Prisma.WorkflowBlockToBlockModel
/**
* Model WorkflowExecution
*
*/
export type WorkflowExecution = Prisma.WorkflowExecutionModel
/**
* Model WorkflowInputExample
*
*/
export type WorkflowInputExample = Prisma.WorkflowInputExampleModel
/**
* Model WorkflowBlockExecution
*
*/
export type WorkflowBlockExecution = Prisma.WorkflowBlockExecutionModel
/**
* Model WorkflowVariable
*
*/
export type WorkflowVariable = Prisma.WorkflowVariableModel
/**
* Model WorkflowCredential
*
*/
export type WorkflowCredential = Prisma.WorkflowCredentialModel
@@ -0,0 +1,956 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
*
* 🟢 You can import this file directly.
*/
import * as process from 'node:process'
import * as path from 'node:path'
import { fileURLToPath } from 'node:url'
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
import * as runtime from "@prisma/client/runtime/client"
import * as $Enums from "./enums.ts"
import * as $Class from "./internal/class.ts"
import * as Prisma from "./internal/prismaNamespace.ts"
export * as $Enums from './enums.ts'
export * from "./enums.ts"
/**
* ## Prisma Client
*
* Type-safe database client for TypeScript
* @example
* ```
* const prisma = new PrismaClient({
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
* })
* // Fetch zero or more Users
* const users = await prisma.user.findMany()
* ```
*
* Read more in our [docs](https://pris.ly/d/client).
*/
export const PrismaClient = $Class.getPrismaClientClass()
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
export { Prisma }
/**
* Model User
*
*/
export type User = Prisma.UserModel
/**
* Model MagicLinkToken
*
*/
export type MagicLinkToken = Prisma.MagicLinkTokenModel
/**
* Model AdminUser
*
*/
export type AdminUser = Prisma.AdminUserModel
/**
* Model Tenant
*
*/
export type Tenant = Prisma.TenantModel
/**
* Model WorkspaceAuthProvider
*
*/
export type WorkspaceAuthProvider = Prisma.WorkspaceAuthProviderModel
/**
* Model ImpersonationAudit
*
*/
export type ImpersonationAudit = Prisma.ImpersonationAuditModel
/**
* Model TenantUser
*
*/
export type TenantUser = Prisma.TenantUserModel
/**
* Model TenantUserInvitation
*
*/
export type TenantUserInvitation = Prisma.TenantUserInvitationModel
/**
* Model Registration
*
*/
export type Registration = Prisma.RegistrationModel
/**
* Model Blacklist
*
*/
export type Blacklist = Prisma.BlacklistModel
/**
* Model TenantIpAddress
*
*/
export type TenantIpAddress = Prisma.TenantIpAddressModel
/**
* Model TenantType
*
*/
export type TenantType = Prisma.TenantTypeModel
/**
* Model Activity
* User-facing business activity timeline (M045 / M01 Block E).
*
* DISTINCT from the tamper-evident, hash-chained `AuditEvent` (M001): `Activity`
* is the per-entity, human-readable stream shown to tenant users (calls, notes,
* emails, status changes, …). Every writing module appends here via
* `logActivity()` from `@hivegrid/activity` (AGENTS DoD #14).
*
* `activityType` and `subjectType` are stored as strings (extensible per module —
* see the `ActivityType` / `ActivitySubjectType` unions in `@hivegrid/activity`),
* not Prisma enums, to avoid a schema migration for every new module event.
*
* Tenant isolation: RLS policy is added with M27 (Auth/Tenancy); until then access
* is App-Level-scoped via the tenant-scoped query helpers.
*/
export type Activity = Prisma.ActivityModel
/**
* Model AnalyticsSettings
*
*/
export type AnalyticsSettings = Prisma.AnalyticsSettingsModel
/**
* Model AnalyticsUniqueVisitor
*
*/
export type AnalyticsUniqueVisitor = Prisma.AnalyticsUniqueVisitorModel
/**
* Model AnalyticsPageView
*
*/
export type AnalyticsPageView = Prisma.AnalyticsPageViewModel
/**
* Model AnalyticsEvent
*
*/
export type AnalyticsEvent = Prisma.AnalyticsEventModel
/**
* Model App
*
*/
export type App = Prisma.AppModel
/**
* Model DataConnection
*
*/
export type DataConnection = Prisma.DataConnectionModel
/**
* Model AppSyncRun
*
*/
export type AppSyncRun = Prisma.AppSyncRunModel
/**
* Model AppSyncRunLog
*
*/
export type AppSyncRunLog = Prisma.AppSyncRunLogModel
/**
* Model AppSyncItem
*
*/
export type AppSyncItem = Prisma.AppSyncItemModel
/**
* Model UserSession
*
*/
export type UserSession = Prisma.UserSessionModel
/**
* Model TrustedDevice
*
*/
export type TrustedDevice = Prisma.TrustedDeviceModel
/**
* Model CollabDoc
*
*/
export type CollabDoc = Prisma.CollabDocModel
/**
* Model AppConfiguration
*
*/
export type AppConfiguration = Prisma.AppConfigurationModel
/**
* Model Log
*
*/
export type Log = Prisma.LogModel
/**
* Model AuditEvent
*
*/
export type AuditEvent = Prisma.AuditEventModel
/**
* Model IdempotencyKey
*
*/
export type IdempotencyKey = Prisma.IdempotencyKeyModel
/**
* Model ApiKey
*
*/
export type ApiKey = Prisma.ApiKeyModel
/**
* Model ApiKeyLog
*
*/
export type ApiKeyLog = Prisma.ApiKeyLogModel
/**
* Model Event
*
*/
export type Event = Prisma.EventModel
/**
* Model EventWebhookAttempt
*
*/
export type EventWebhookAttempt = Prisma.EventWebhookAttemptModel
/**
* Model MetricLog
*
*/
export type MetricLog = Prisma.MetricLogModel
/**
* Model FileUploadProgress
*
*/
export type FileUploadProgress = Prisma.FileUploadProgressModel
/**
* Model FileChunk
*
*/
export type FileChunk = Prisma.FileChunkModel
/**
* Model FileObject
*
*/
export type FileObject = Prisma.FileObjectModel
/**
* Model IpAddress
* Privacy (AD-22): `ip` speichert einen HMAC-SHA256-Pseudonym-Hash der Client-IP, KEINE Klartext-IP.
* Persistiert wird nur das Land (countryCode/countryName); regionCode/city/zipCode/latitude/longitude
* bleiben bewusst leer. Auflösung lokal (DB-IP Lite), kein externer Transfer.
*/
export type IpAddress = Prisma.IpAddressModel
/**
* Model IpAddressLog
* Privacy (AD-22): `ip` ist der HMAC-Pseudonym-Hash der Client-IP, kein Klartext.
*/
export type IpAddressLog = Prisma.IpAddressLogModel
/**
* Model Widget
*
*/
export type Widget = Prisma.WidgetModel
/**
* Model Credential
*
*/
export type Credential = Prisma.CredentialModel
/**
* Model TenantInboundAddress
*
*/
export type TenantInboundAddress = Prisma.TenantInboundAddressModel
/**
* Model Email
*
*/
export type Email = Prisma.EmailModel
/**
* Model EmailRead
*
*/
export type EmailRead = Prisma.EmailReadModel
/**
* Model EmailCc
*
*/
export type EmailCc = Prisma.EmailCcModel
/**
* Model EmailAttachment
*
*/
export type EmailAttachment = Prisma.EmailAttachmentModel
/**
* Model EmailSender
*
*/
export type EmailSender = Prisma.EmailSenderModel
/**
* Model Campaign
*
*/
export type Campaign = Prisma.CampaignModel
/**
* Model OutboundEmail
*
*/
export type OutboundEmail = Prisma.OutboundEmailModel
/**
* Model OutboundEmailOpen
*
*/
export type OutboundEmailOpen = Prisma.OutboundEmailOpenModel
/**
* Model OutboundEmailClick
*
*/
export type OutboundEmailClick = Prisma.OutboundEmailClickModel
/**
* Model EmailSequence
*
*/
export type EmailSequence = Prisma.EmailSequenceModel
/**
* Model EmailSequenceRun
*
*/
export type EmailSequenceRun = Prisma.EmailSequenceRunModel
/**
* Model EmailSequenceStepDelivery
*
*/
export type EmailSequenceStepDelivery = Prisma.EmailSequenceStepDeliveryModel
/**
* Model Entity
*
*/
export type Entity = Prisma.EntityModel
/**
* Model Property
*
*/
export type Property = Prisma.PropertyModel
/**
* Model EntityView
*
*/
export type EntityView = Prisma.EntityViewModel
/**
* Model EntityViewProperty
*
*/
export type EntityViewProperty = Prisma.EntityViewPropertyModel
/**
* Model EntityViewFilter
*
*/
export type EntityViewFilter = Prisma.EntityViewFilterModel
/**
* Model EntityViewSort
*
*/
export type EntityViewSort = Prisma.EntityViewSortModel
/**
* Model PropertyAttribute
*
*/
export type PropertyAttribute = Prisma.PropertyAttributeModel
/**
* Model PropertyOption
*
*/
export type PropertyOption = Prisma.PropertyOptionModel
/**
* Model EntityTag
*
*/
export type EntityTag = Prisma.EntityTagModel
/**
* Model EntityTenantUserPermission
*
*/
export type EntityTenantUserPermission = Prisma.EntityTenantUserPermissionModel
/**
* Model EntityWebhook
*
*/
export type EntityWebhook = Prisma.EntityWebhookModel
/**
* Model EntityWebhookLog
*
*/
export type EntityWebhookLog = Prisma.EntityWebhookLogModel
/**
* Model EntityRelationship
*
*/
export type EntityRelationship = Prisma.EntityRelationshipModel
/**
* Model SampleCustomEntity
*
*/
export type SampleCustomEntity = Prisma.SampleCustomEntityModel
/**
* Model RowRelationship
*
*/
export type RowRelationship = Prisma.RowRelationshipModel
/**
* Model Row
*
*/
export type Row = Prisma.RowModel
/**
* Model RowValue
*
*/
export type RowValue = Prisma.RowValueModel
/**
* Model RowValueMultiple
*
*/
export type RowValueMultiple = Prisma.RowValueMultipleModel
/**
* Model RowValueRange
*
*/
export type RowValueRange = Prisma.RowValueRangeModel
/**
* Model RowPermission
*
*/
export type RowPermission = Prisma.RowPermissionModel
/**
* Model RowMedia
*
*/
export type RowMedia = Prisma.RowMediaModel
/**
* Model RowTag
*
*/
export type RowTag = Prisma.RowTagModel
/**
* Model RowComment
*
*/
export type RowComment = Prisma.RowCommentModel
/**
* Model RowCommentReaction
*
*/
export type RowCommentReaction = Prisma.RowCommentReactionModel
/**
* Model RowTask
*
*/
export type RowTask = Prisma.RowTaskModel
/**
* Model EntityTemplate
*
*/
export type EntityTemplate = Prisma.EntityTemplateModel
/**
* Model EntityGroup
*
*/
export type EntityGroup = Prisma.EntityGroupModel
/**
* Model EntityGroupEntity
*
*/
export type EntityGroupEntity = Prisma.EntityGroupEntityModel
/**
* Model Formula
*
*/
export type Formula = Prisma.FormulaModel
/**
* Model FormulaComponent
*
*/
export type FormulaComponent = Prisma.FormulaComponentModel
/**
* Model FormulaLog
*
*/
export type FormulaLog = Prisma.FormulaLogModel
/**
* Model FormulaComponentLog
*
*/
export type FormulaComponentLog = Prisma.FormulaComponentLogModel
/**
* Model EntityGroupConfiguration
*
*/
export type EntityGroupConfiguration = Prisma.EntityGroupConfigurationModel
/**
* Model EntityGroupConfigurationRow
*
*/
export type EntityGroupConfigurationRow = Prisma.EntityGroupConfigurationRowModel
/**
* Model ApiKeyEntity
*
*/
export type ApiKeyEntity = Prisma.ApiKeyEntityModel
/**
* Model TenantSettingsRow
*
*/
export type TenantSettingsRow = Prisma.TenantSettingsRowModel
/**
* Model EntityLink
* A directed, role-labelled link from one entity to another, scoped per tenant.
* Idempotent on the unique tuple (upsert in entityLinkService).
*/
export type EntityLink = Prisma.EntityLinkModel
/**
* Model FeatureFlag
*
*/
export type FeatureFlag = Prisma.FeatureFlagModel
/**
* Model FeatureFlagFilter
*
*/
export type FeatureFlagFilter = Prisma.FeatureFlagFilterModel
/**
* Model FeatureFlagAudit
* Append-only audit trail for every mutation of a FeatureFlag (create / update / delete / toggle).
* Never UPDATE or DELETE rows from app code — preserves tamper-resistance for compliance.
*/
export type FeatureFlagAudit = Prisma.FeatureFlagAuditModel
/**
* Model File
* A stored file, scoped per tenant. `storageKey` points at the original object
* in the private Hetzner bucket (AD-23); delivery is only via the auth-proxy
* route. Soft-delete via `archivedAt` (archive flag). Hard-delete is a separate
* action (files.delete).
*/
export type File = Prisma.FileModel
/**
* Model FileEntityLink
* Polymorphic link of a file to any entity (cross-cutting). `entityType` +
* `entityId` address the target entity, `linkRole` is an optional role label
* (e.g. "contract", "photo").
*/
export type FileEntityLink = Prisma.FileEntityLinkModel
/**
* Model FileUpload
* Chunked-upload session (replaces spec `FileUploadProgress`, renamed to avoid
* the core collision). No resume in v1 — this session only carries progress up
* to `complete`. `expiresAt` = now + 24h; a cleanup cron sweeps expired
* sessions + temp chunks.
*/
export type FileUpload = Prisma.FileUploadModel
/**
* Model FileUploadChunk
* One uploaded chunk of a `FileUpload` session (replaces spec `FileChunk`).
* Bytes live in temp storage (`storageKey`), not in the DB.
*/
export type FileUploadChunk = Prisma.FileUploadChunkModel
/**
* Model Form
*
*/
export type Form = Prisma.FormModel
/**
* Model FormSubmission
*
*/
export type FormSubmission = Prisma.FormSubmissionModel
/**
* Model Feedback
*
*/
export type Feedback = Prisma.FeedbackModel
/**
* Model SupportTicket
*
*/
export type SupportTicket = Prisma.SupportTicketModel
/**
* Model ImportJob
*
*/
export type ImportJob = Prisma.ImportJobModel
/**
* Model KnowledgeBase
*
*/
export type KnowledgeBase = Prisma.KnowledgeBaseModel
/**
* Model KnowledgeBaseCategory
*
*/
export type KnowledgeBaseCategory = Prisma.KnowledgeBaseCategoryModel
/**
* Model KnowledgeBaseCategorySection
*
*/
export type KnowledgeBaseCategorySection = Prisma.KnowledgeBaseCategorySectionModel
/**
* Model KnowledgeBaseArticle
*
*/
export type KnowledgeBaseArticle = Prisma.KnowledgeBaseArticleModel
/**
* Model KnowledgeBaseRelatedArticle
*
*/
export type KnowledgeBaseRelatedArticle = Prisma.KnowledgeBaseRelatedArticleModel
/**
* Model KnowledgeBaseViews
*
*/
export type KnowledgeBaseViews = Prisma.KnowledgeBaseViewsModel
/**
* Model KnowledgeBaseArticleViews
*
*/
export type KnowledgeBaseArticleViews = Prisma.KnowledgeBaseArticleViewsModel
/**
* Model KnowledgeBaseArticleUpvotes
*
*/
export type KnowledgeBaseArticleUpvotes = Prisma.KnowledgeBaseArticleUpvotesModel
/**
* Model KnowledgeBaseArticleDownvotes
*
*/
export type KnowledgeBaseArticleDownvotes = Prisma.KnowledgeBaseArticleDownvotesModel
/**
* Model Lead
*
*/
export type Lead = Prisma.LeadModel
/**
* Model LeadEvent
*
*/
export type LeadEvent = Prisma.LeadEventModel
/**
* Model TenantAcquisition
*
*/
export type TenantAcquisition = Prisma.TenantAcquisitionModel
/**
* Model MarketingIntegration
*
*/
export type MarketingIntegration = Prisma.MarketingIntegrationModel
/**
* Model NotificationDelivery
*
*/
export type NotificationDelivery = Prisma.NotificationDeliveryModel
/**
* Model UserNotificationPreference
*
*/
export type UserNotificationPreference = Prisma.UserNotificationPreferenceModel
/**
* Model DeviceToken
*
*/
export type DeviceToken = Prisma.DeviceTokenModel
/**
* Model Onboarding
*
*/
export type Onboarding = Prisma.OnboardingModel
/**
* Model OnboardingFilter
*
*/
export type OnboardingFilter = Prisma.OnboardingFilterModel
/**
* Model OnboardingStep
*
*/
export type OnboardingStep = Prisma.OnboardingStepModel
/**
* Model OnboardingSession
*
*/
export type OnboardingSession = Prisma.OnboardingSessionModel
/**
* Model OnboardingSessionAction
*
*/
export type OnboardingSessionAction = Prisma.OnboardingSessionActionModel
/**
* Model OnboardingSessionFilterMatch
*
*/
export type OnboardingSessionFilterMatch = Prisma.OnboardingSessionFilterMatchModel
/**
* Model OnboardingSessionStep
*
*/
export type OnboardingSessionStep = Prisma.OnboardingSessionStepModel
/**
* Model OutboxEvent
*
*/
export type OutboxEvent = Prisma.OutboxEventModel
/**
* Model Role
*
*/
export type Role = Prisma.RoleModel
/**
* Model Permission
*
*/
export type Permission = Prisma.PermissionModel
/**
* Model RolePermission
*
*/
export type RolePermission = Prisma.RolePermissionModel
/**
* Model UserRole
*
*/
export type UserRole = Prisma.UserRoleModel
/**
* Model Group
*
*/
export type Group = Prisma.GroupModel
/**
* Model GroupUser
*
*/
export type GroupUser = Prisma.GroupUserModel
/**
* Model Plugin
*
*/
export type Plugin = Prisma.PluginModel
/**
* Model TenantPluginCapabilityGrant
*
*/
export type TenantPluginCapabilityGrant = Prisma.TenantPluginCapabilityGrantModel
/**
* Model PluginUserConfig
*
*/
export type PluginUserConfig = Prisma.PluginUserConfigModel
/**
* Model PluginInvocation
*
*/
export type PluginInvocation = Prisma.PluginInvocationModel
/**
* Model PluginCapabilityUse
*
*/
export type PluginCapabilityUse = Prisma.PluginCapabilityUseModel
/**
* Model Portal
*
*/
export type Portal = Prisma.PortalModel
/**
* Model PortalUser
*
*/
export type PortalUser = Prisma.PortalUserModel
/**
* Model PortalPage
*
*/
export type PortalPage = Prisma.PortalPageModel
/**
* Model PortalUserRegistration
*
*/
export type PortalUserRegistration = Prisma.PortalUserRegistrationModel
/**
* Model PortalSubscriptionProduct
*
*/
export type PortalSubscriptionProduct = Prisma.PortalSubscriptionProductModel
/**
* Model PortalSubscriptionPrice
*
*/
export type PortalSubscriptionPrice = Prisma.PortalSubscriptionPriceModel
/**
* Model PortalSubscriptionFeature
*
*/
export type PortalSubscriptionFeature = Prisma.PortalSubscriptionFeatureModel
/**
* Model PortalUserSubscription
*
*/
export type PortalUserSubscription = Prisma.PortalUserSubscriptionModel
/**
* Model PortalUserSubscriptionProduct
*
*/
export type PortalUserSubscriptionProduct = Prisma.PortalUserSubscriptionProductModel
/**
* Model PortalUserSubscriptionProductPrice
*
*/
export type PortalUserSubscriptionProductPrice = Prisma.PortalUserSubscriptionProductPriceModel
/**
* Model PortalCheckoutSessionStatus
*
*/
export type PortalCheckoutSessionStatus = Prisma.PortalCheckoutSessionStatusModel
/**
* Model QueueFailedJob
*
*/
export type QueueFailedJob = Prisma.QueueFailedJobModel
/**
* Model ExportJob
*
*/
export type ExportJob = Prisma.ExportJobModel
/**
* Model Site
*
*/
export type Site = Prisma.SiteModel
/**
* Model SubscriptionProduct
*
*/
export type SubscriptionProduct = Prisma.SubscriptionProductModel
/**
* Model SubscriptionPrice
*
*/
export type SubscriptionPrice = Prisma.SubscriptionPriceModel
/**
* Model SubscriptionUsageBasedPrice
*
*/
export type SubscriptionUsageBasedPrice = Prisma.SubscriptionUsageBasedPriceModel
/**
* Model SubscriptionUsageBasedTier
*
*/
export type SubscriptionUsageBasedTier = Prisma.SubscriptionUsageBasedTierModel
/**
* Model SubscriptionFeature
*
*/
export type SubscriptionFeature = Prisma.SubscriptionFeatureModel
/**
* Model TenantSubscription
*
*/
export type TenantSubscription = Prisma.TenantSubscriptionModel
/**
* Model TenantSubscriptionProduct
*
*/
export type TenantSubscriptionProduct = Prisma.TenantSubscriptionProductModel
/**
* Model TenantSubscriptionProductPrice
*
*/
export type TenantSubscriptionProductPrice = Prisma.TenantSubscriptionProductPriceModel
/**
* Model TenantSubscriptionUsageRecord
*
*/
export type TenantSubscriptionUsageRecord = Prisma.TenantSubscriptionUsageRecordModel
/**
* Model TenantProductConfiguration
*
*/
export type TenantProductConfiguration = Prisma.TenantProductConfigurationModel
/**
* Model TenantFeatureOverride
*
*/
export type TenantFeatureOverride = Prisma.TenantFeatureOverrideModel
/**
* Model CheckoutSessionStatus
*
*/
export type CheckoutSessionStatus = Prisma.CheckoutSessionStatusModel
/**
* Model Credit
*
*/
export type Credit = Prisma.CreditModel
/**
* Model Task
* A task, scoped per tenant. Soft-delete via `archivedAt` (archive flag). A
* completed task (`status = done`, `completedAt` set) is auto-archived 30 days
* later by a maintenance cron.
*/
export type Task = Prisma.TaskModel
/**
* Model TaskWatcher
* A user watching a task (M:N). Watchers receive reminder notifications in
* addition to the assignee.
*/
export type TaskWatcher = Prisma.TaskWatcherModel
/**
* Model Workflow
*
*/
export type Workflow = Prisma.WorkflowModel
/**
* Model WorkflowBlock
*
*/
export type WorkflowBlock = Prisma.WorkflowBlockModel
/**
* Model WorkflowBlockConditionGroup
*
*/
export type WorkflowBlockConditionGroup = Prisma.WorkflowBlockConditionGroupModel
/**
* Model WorkflowBlockCondition
*
*/
export type WorkflowBlockCondition = Prisma.WorkflowBlockConditionModel
/**
* Model WorkflowBlockToBlock
*
*/
export type WorkflowBlockToBlock = Prisma.WorkflowBlockToBlockModel
/**
* Model WorkflowExecution
*
*/
export type WorkflowExecution = Prisma.WorkflowExecutionModel
/**
* Model WorkflowInputExample
*
*/
export type WorkflowInputExample = Prisma.WorkflowInputExampleModel
/**
* Model WorkflowBlockExecution
*
*/
export type WorkflowBlockExecution = Prisma.WorkflowBlockExecutionModel
/**
* Model WorkflowVariable
*
*/
export type WorkflowVariable = Prisma.WorkflowVariableModel
/**
* Model WorkflowCredential
*
*/
export type WorkflowCredential = Prisma.WorkflowCredentialModel
@@ -0,0 +1,205 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file exports all enum related types from the schema.
*
* 🟢 You can import this file directly.
*/
export const ActivityActorKind = {
user: 'user',
system: 'system',
automation: 'automation',
ki_agent: 'ki_agent'
} as const
export type ActivityActorKind = (typeof ActivityActorKind)[keyof typeof ActivityActorKind]
export const LinkableEntityType = {
contact: 'contact',
company: 'company',
lead: 'lead',
deal: 'deal',
project: 'project',
task: 'task',
file: 'file',
user: 'user',
order: 'order',
appointment: 'appointment',
form_submission: 'form_submission'
} as const
export type LinkableEntityType = (typeof LinkableEntityType)[keyof typeof LinkableEntityType]
export const FilePreviewStatus = {
pending: 'pending',
generating: 'generating',
ready: 'ready',
failed: 'failed',
not_supported: 'not_supported'
} as const
export type FilePreviewStatus = (typeof FilePreviewStatus)[keyof typeof FilePreviewStatus]
export const FileScanStatus = {
pending: 'pending',
clean: 'clean',
infected: 'infected',
skipped: 'skipped'
} as const
export type FileScanStatus = (typeof FileScanStatus)[keyof typeof FileScanStatus]
export const FileSource = {
manual_upload: 'manual_upload',
customer_portal: 'customer_portal',
form_submission: 'form_submission',
email_attachment: 'email_attachment',
automation: 'automation',
api: 'api'
} as const
export type FileSource = (typeof FileSource)[keyof typeof FileSource]
export const FileUploadStatus = {
in_progress: 'in_progress',
completed: 'completed',
failed: 'failed',
expired: 'expired',
cancelled: 'cancelled'
} as const
export type FileUploadStatus = (typeof FileUploadStatus)[keyof typeof FileUploadStatus]
export const FileEntityType = {
contact: 'contact',
company: 'company',
lead: 'lead',
deal: 'deal',
project: 'project',
user: 'user',
form_submission: 'form_submission',
order: 'order',
task: 'task',
appointment: 'appointment'
} as const
export type FileEntityType = (typeof FileEntityType)[keyof typeof FileEntityType]
export const ImportJobStatus = {
PENDING: 'PENDING',
RUNNING: 'RUNNING',
COMPLETED: 'COMPLETED',
FAILED: 'FAILED'
} as const
export type ImportJobStatus = (typeof ImportJobStatus)[keyof typeof ImportJobStatus]
export const LeadStatus = {
new: 'new',
contacted: 'contacted',
qualified: 'qualified',
trial: 'trial',
customer: 'customer',
churned: 'churned',
disqualified: 'disqualified'
} as const
export type LeadStatus = (typeof LeadStatus)[keyof typeof LeadStatus]
export const NotificationDeliveryStatus = {
PENDING: 'PENDING',
SENT: 'SENT',
FAILED: 'FAILED',
SKIPPED: 'SKIPPED',
READ: 'READ'
} as const
export type NotificationDeliveryStatus = (typeof NotificationDeliveryStatus)[keyof typeof NotificationDeliveryStatus]
export const NotificationPreferenceChannel = {
IN_APP: 'IN_APP',
EMAIL: 'EMAIL'
} as const
export type NotificationPreferenceChannel = (typeof NotificationPreferenceChannel)[keyof typeof NotificationPreferenceChannel]
export const OutboxStatus = {
PENDING: 'PENDING',
PROCESSING: 'PROCESSING',
DONE: 'DONE',
FAILED: 'FAILED',
CANCELLED: 'CANCELLED'
} as const
export type OutboxStatus = (typeof OutboxStatus)[keyof typeof OutboxStatus]
export const ExportJobStatus = {
PENDING: 'PENDING',
RUNNING: 'RUNNING',
COMPLETED: 'COMPLETED',
FAILED: 'FAILED'
} as const
export type ExportJobStatus = (typeof ExportJobStatus)[keyof typeof ExportJobStatus]
export const TaskStatus = {
open: 'open',
in_progress: 'in_progress',
blocked: 'blocked',
done: 'done',
cancelled: 'cancelled'
} as const
export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus]
export const TaskPriority = {
low: 'low',
normal: 'normal',
high: 'high',
urgent: 'urgent'
} as const
export type TaskPriority = (typeof TaskPriority)[keyof typeof TaskPriority]
export const TaskSource = {
manual: 'manual',
chat: 'chat',
form_submission: 'form_submission',
automation: 'automation',
api: 'api'
} as const
export type TaskSource = (typeof TaskSource)[keyof typeof TaskSource]
export const TaskEntityType = {
contact: 'contact',
company: 'company',
lead: 'lead',
deal: 'deal',
project: 'project',
user: 'user',
order: 'order',
appointment: 'appointment'
} as const
export type TaskEntityType = (typeof TaskEntityType)[keyof typeof TaskEntityType]
@@ -0,0 +1,188 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This is a barrel export file for all models and their related types.
*
* 🟢 You can import this file directly.
*/
export type * from './models/User.ts'
export type * from './models/MagicLinkToken.ts'
export type * from './models/AdminUser.ts'
export type * from './models/Tenant.ts'
export type * from './models/WorkspaceAuthProvider.ts'
export type * from './models/ImpersonationAudit.ts'
export type * from './models/TenantUser.ts'
export type * from './models/TenantUserInvitation.ts'
export type * from './models/Registration.ts'
export type * from './models/Blacklist.ts'
export type * from './models/TenantIpAddress.ts'
export type * from './models/TenantType.ts'
export type * from './models/Activity.ts'
export type * from './models/AnalyticsSettings.ts'
export type * from './models/AnalyticsUniqueVisitor.ts'
export type * from './models/AnalyticsPageView.ts'
export type * from './models/AnalyticsEvent.ts'
export type * from './models/App.ts'
export type * from './models/DataConnection.ts'
export type * from './models/AppSyncRun.ts'
export type * from './models/AppSyncRunLog.ts'
export type * from './models/AppSyncItem.ts'
export type * from './models/UserSession.ts'
export type * from './models/TrustedDevice.ts'
export type * from './models/CollabDoc.ts'
export type * from './models/AppConfiguration.ts'
export type * from './models/Log.ts'
export type * from './models/AuditEvent.ts'
export type * from './models/IdempotencyKey.ts'
export type * from './models/ApiKey.ts'
export type * from './models/ApiKeyLog.ts'
export type * from './models/Event.ts'
export type * from './models/EventWebhookAttempt.ts'
export type * from './models/MetricLog.ts'
export type * from './models/FileUploadProgress.ts'
export type * from './models/FileChunk.ts'
export type * from './models/FileObject.ts'
export type * from './models/IpAddress.ts'
export type * from './models/IpAddressLog.ts'
export type * from './models/Widget.ts'
export type * from './models/Credential.ts'
export type * from './models/TenantInboundAddress.ts'
export type * from './models/Email.ts'
export type * from './models/EmailRead.ts'
export type * from './models/EmailCc.ts'
export type * from './models/EmailAttachment.ts'
export type * from './models/EmailSender.ts'
export type * from './models/Campaign.ts'
export type * from './models/OutboundEmail.ts'
export type * from './models/OutboundEmailOpen.ts'
export type * from './models/OutboundEmailClick.ts'
export type * from './models/EmailSequence.ts'
export type * from './models/EmailSequenceRun.ts'
export type * from './models/EmailSequenceStepDelivery.ts'
export type * from './models/Entity.ts'
export type * from './models/Property.ts'
export type * from './models/EntityView.ts'
export type * from './models/EntityViewProperty.ts'
export type * from './models/EntityViewFilter.ts'
export type * from './models/EntityViewSort.ts'
export type * from './models/PropertyAttribute.ts'
export type * from './models/PropertyOption.ts'
export type * from './models/EntityTag.ts'
export type * from './models/EntityTenantUserPermission.ts'
export type * from './models/EntityWebhook.ts'
export type * from './models/EntityWebhookLog.ts'
export type * from './models/EntityRelationship.ts'
export type * from './models/SampleCustomEntity.ts'
export type * from './models/RowRelationship.ts'
export type * from './models/Row.ts'
export type * from './models/RowValue.ts'
export type * from './models/RowValueMultiple.ts'
export type * from './models/RowValueRange.ts'
export type * from './models/RowPermission.ts'
export type * from './models/RowMedia.ts'
export type * from './models/RowTag.ts'
export type * from './models/RowComment.ts'
export type * from './models/RowCommentReaction.ts'
export type * from './models/RowTask.ts'
export type * from './models/EntityTemplate.ts'
export type * from './models/EntityGroup.ts'
export type * from './models/EntityGroupEntity.ts'
export type * from './models/Formula.ts'
export type * from './models/FormulaComponent.ts'
export type * from './models/FormulaLog.ts'
export type * from './models/FormulaComponentLog.ts'
export type * from './models/EntityGroupConfiguration.ts'
export type * from './models/EntityGroupConfigurationRow.ts'
export type * from './models/ApiKeyEntity.ts'
export type * from './models/TenantSettingsRow.ts'
export type * from './models/EntityLink.ts'
export type * from './models/FeatureFlag.ts'
export type * from './models/FeatureFlagFilter.ts'
export type * from './models/FeatureFlagAudit.ts'
export type * from './models/File.ts'
export type * from './models/FileEntityLink.ts'
export type * from './models/FileUpload.ts'
export type * from './models/FileUploadChunk.ts'
export type * from './models/Form.ts'
export type * from './models/FormSubmission.ts'
export type * from './models/Feedback.ts'
export type * from './models/SupportTicket.ts'
export type * from './models/ImportJob.ts'
export type * from './models/KnowledgeBase.ts'
export type * from './models/KnowledgeBaseCategory.ts'
export type * from './models/KnowledgeBaseCategorySection.ts'
export type * from './models/KnowledgeBaseArticle.ts'
export type * from './models/KnowledgeBaseRelatedArticle.ts'
export type * from './models/KnowledgeBaseViews.ts'
export type * from './models/KnowledgeBaseArticleViews.ts'
export type * from './models/KnowledgeBaseArticleUpvotes.ts'
export type * from './models/KnowledgeBaseArticleDownvotes.ts'
export type * from './models/Lead.ts'
export type * from './models/LeadEvent.ts'
export type * from './models/TenantAcquisition.ts'
export type * from './models/MarketingIntegration.ts'
export type * from './models/NotificationDelivery.ts'
export type * from './models/UserNotificationPreference.ts'
export type * from './models/DeviceToken.ts'
export type * from './models/Onboarding.ts'
export type * from './models/OnboardingFilter.ts'
export type * from './models/OnboardingStep.ts'
export type * from './models/OnboardingSession.ts'
export type * from './models/OnboardingSessionAction.ts'
export type * from './models/OnboardingSessionFilterMatch.ts'
export type * from './models/OnboardingSessionStep.ts'
export type * from './models/OutboxEvent.ts'
export type * from './models/Role.ts'
export type * from './models/Permission.ts'
export type * from './models/RolePermission.ts'
export type * from './models/UserRole.ts'
export type * from './models/Group.ts'
export type * from './models/GroupUser.ts'
export type * from './models/Plugin.ts'
export type * from './models/TenantPluginCapabilityGrant.ts'
export type * from './models/PluginUserConfig.ts'
export type * from './models/PluginInvocation.ts'
export type * from './models/PluginCapabilityUse.ts'
export type * from './models/Portal.ts'
export type * from './models/PortalUser.ts'
export type * from './models/PortalPage.ts'
export type * from './models/PortalUserRegistration.ts'
export type * from './models/PortalSubscriptionProduct.ts'
export type * from './models/PortalSubscriptionPrice.ts'
export type * from './models/PortalSubscriptionFeature.ts'
export type * from './models/PortalUserSubscription.ts'
export type * from './models/PortalUserSubscriptionProduct.ts'
export type * from './models/PortalUserSubscriptionProductPrice.ts'
export type * from './models/PortalCheckoutSessionStatus.ts'
export type * from './models/QueueFailedJob.ts'
export type * from './models/ExportJob.ts'
export type * from './models/Site.ts'
export type * from './models/SubscriptionProduct.ts'
export type * from './models/SubscriptionPrice.ts'
export type * from './models/SubscriptionUsageBasedPrice.ts'
export type * from './models/SubscriptionUsageBasedTier.ts'
export type * from './models/SubscriptionFeature.ts'
export type * from './models/TenantSubscription.ts'
export type * from './models/TenantSubscriptionProduct.ts'
export type * from './models/TenantSubscriptionProductPrice.ts'
export type * from './models/TenantSubscriptionUsageRecord.ts'
export type * from './models/TenantProductConfiguration.ts'
export type * from './models/TenantFeatureOverride.ts'
export type * from './models/CheckoutSessionStatus.ts'
export type * from './models/Credit.ts'
export type * from './models/Task.ts'
export type * from './models/TaskWatcher.ts'
export type * from './models/Workflow.ts'
export type * from './models/WorkflowBlock.ts'
export type * from './models/WorkflowBlockConditionGroup.ts'
export type * from './models/WorkflowBlockCondition.ts'
export type * from './models/WorkflowBlockToBlock.ts'
export type * from './models/WorkflowExecution.ts'
export type * from './models/WorkflowInputExample.ts'
export type * from './models/WorkflowBlockExecution.ts'
export type * from './models/WorkflowVariable.ts'
export type * from './models/WorkflowCredential.ts'
export type * from './commonInputTypes.ts'
Loaded 100 of 5885 files, more files were not shown because too many files have changed in this diff. Show more