Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- generator client {
- provider = "prisma-client-js"
- }
- datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
- }
- model User {
- id String @id
- email String @unique
- firstName String
- lastName String
- role UserRole @default(applicant)
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- devId String? @unique
- hashedPassword String?
- emailVerified DateTime?
- Account Account[]
- applications Application[] @relation("ApplicationToUser")
- conversations Conversation[]
- conversationSessionLog ConversationSessionLog[]
- ConversationsToUsers ConversationsToUsers[]
- messages Message[]
- Session Session[]
- WorkflowSchema WorkflowSchema[]
- authorizedOrganizationsStatuses OrganizationStatus[] @relation("AuthorizedUsers")
- Chore Chore[] @relation("ChoreToUser")
- ChoreTrigger ChoreTrigger[] @relation("ChoreTriggerToUser")
- organizations Organization[] @relation("OrganizationToUser")
- }
- model TempUserHashPassword {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- hashedPassword String
- userId String
- }
- model Message {
- id String @id @default(cuid())
- text String
- timestamp DateTime @default(now())
- messageType MessageType
- aiThoughtProcess String?
- approvedById String?
- approvedAt DateTime?
- conversationId String
- uploadRequired Boolean @default(false)
- systemMessage String?
- subject String? @default("")
- attachments String[] @default([])
- source Company?
- sourceId String?
- contactId String?
- approvedBy User? @relation(fields: [approvedById], references: [id])
- contact Contact? @relation(fields: [contactId], references: [id])
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- }
- model ClientFile {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- requiredName String
- uploadedName String?
- conversationId String
- url String?
- previewUrl String?
- status ClientFileStatus @default(pending)
- Description String?
- RejectionReasoning String?
- Visibility Visibility @default(private)
- fileType String?
- statusId String?
- documentType DocumentType @default(OTHER)
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- extractedValues ExtractedValue[]
- }
- model ExtractedValue {
- id String @id @default(cuid())
- name String
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- value String
- clientFileId String
- displayName String
- clientFile ClientFile @relation(fields: [clientFileId], references: [id], onDelete: Cascade)
- }
- model Client {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- name String?
- organizationId String
- activeContactId String?
- caseId String?
- Case Case?
- organization Organization @relation(fields: [organizationId], references: [id])
- contacts Contact[]
- conversations Conversation[] @relation("conversationToClient")
- }
- model Contact {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- detail String
- mode CommunicationMedium
- clientId String
- creationId String?
- Client Client @relation(fields: [clientId], references: [id])
- messages Message[]
- }
- model Account {
- id String @id
- userId String
- type String
- provider String
- providerAccountId String
- refresh_token String?
- access_token String?
- expires_at Int
- token_type String?
- scope String?
- id_token String?
- session_state String?
- User User @relation(fields: [userId], references: [id], onDelete: Cascade)
- @@unique([provider, providerAccountId])
- }
- model LandingContactForm {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- email String
- name String?
- company String?
- message String?
- }
- model EmailVerification {
- id String @id
- expires DateTime
- code String @unique
- userId String @unique
- }
- model Session {
- id String @id
- sessionToken String @unique
- userId String
- expires DateTime
- User User @relation(fields: [userId], references: [id], onDelete: Cascade)
- }
- model Case {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- organizationId String
- aiTimestampLock DateTime @default(now())
- creationId String?
- activeConversationId String?
- clientId String? @unique
- role UserRole @default(lead)
- client Client? @relation(fields: [clientId], references: [id])
- organization Organization @relation(fields: [organizationId], references: [id])
- FunctionTask FunctionTask[]
- Memory Memory[]
- conversations Conversation[] @relation("CaseToConversation")
- }
- model Conversation {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- purpose String @default("")
- organizationId String
- humanOperatorId String?
- productId String
- initial_delay Int @default(30)
- actionStatus ActionStatus @default(PROCESSING)
- conversationStatusUpdatedAt DateTime?
- organizationStatusId String?
- productStatusId String?
- applicationId String?
- aiTimestampLock DateTime @default(now())
- conversationStateId String?
- metadata Json?
- rating Int?
- application Application?
- attributeValues AttributeValue[]
- chores Chore[]
- ClientFact ClientFact[]
- clientFiles ClientFile[]
- humanOperator User? @relation(fields: [humanOperatorId], references: [id])
- organization Organization @relation(fields: [organizationId], references: [id])
- organizationStatus OrganizationStatus? @relation(fields: [organizationStatusId], references: [id])
- product Product @relation(fields: [productId], references: [id])
- ProductStatus ProductStatus? @relation(fields: [productStatusId], references: [id])
- ConversationCheck ConversationCheck[]
- classifications ConversationClassfication[]
- ConversationDisplay ConversationDisplay[]
- conversationSessionLog ConversationSessionLog[]
- ConversationsToUsers ConversationsToUsers[]
- FunctionTask FunctionTask[]
- Memory Memory[]
- messages Message[]
- Reminders Reminders[]
- workflowFieldValues WorkflowFieldValues[]
- workflowSubmissions WorkflowSubmission[]
- cases Case[] @relation("CaseToConversation")
- clients Client[] @relation("conversationToClient")
- }
- model ConversationSessionLog {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- userId String
- conversationId String
- active Boolean @default(true)
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- user User @relation(fields: [userId], references: [id])
- }
- model ConversationsToUsers {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- conversationId String
- userId String
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
- @@unique([conversationId, userId])
- }
- model ConversationCheck {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- conversationId String
- value String?
- status ConversationCheckStatus @default(PENDING)
- description String?
- fieldName String
- formType OrganizationCheckFormType @default(TEXTAREA)
- options String?
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- @@unique([conversationId, fieldName])
- }
- model OrganizationDisplay {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- organizationId String
- fieldName String
- description String?
- ConversationDisplay ConversationDisplay[]
- organization Organization @relation(fields: [organizationId], references: [id])
- }
- model ConversationDisplay {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- conversationId String
- organizationDisplayId String
- value String?
- status displayStatus @default(unknown)
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- organizationDisplay OrganizationDisplay @relation(fields: [organizationDisplayId], references: [id], onDelete: Cascade)
- }
- model Organization {
- id String @id @default(cuid())
- name String
- apiKey String
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- organizationEmail String?
- organizationEmailToken Json?
- organizationHistoryId String?
- description String?
- accentColor String?
- bigLogoUrl String?
- mainColor String?
- smallLogoUrl String?
- websiteUrl String?
- defaultProductId String? @unique
- applications Application[] @relation("OrganizationToApplication")
- Case Case[]
- Chore Chore[]
- Client Client[]
- conversations Conversation[]
- Document Document[]
- defaultProduct Product? @relation("DefaultProduct", fields: [defaultProductId], references: [id])
- OrganizationDisplay OrganizationDisplay[]
- organizationStatuses OrganizationStatus[]
- products Product[] @relation("OrganizationProducts")
- workflow Workflow[]
- users User[] @relation("OrganizationToUser")
- }
- model Product {
- organizationId String
- id String @id @default(cuid())
- name String
- description String
- agentId String
- createdAt DateTime @default(now())
- updatedAt DateTime? @updatedAt
- Attribute Attribute[]
- conversations Conversation[]
- Organization Organization? @relation("DefaultProduct")
- agent Agent @relation(fields: [agentId], references: [id])
- organization Organization @relation("OrganizationProducts", fields: [organizationId], references: [id])
- classicications ProductClassification[]
- productStatuses ProductStatus[]
- WorkflowSchema WorkflowSchema[]
- entities Entity[] @relation("EntityToProduct")
- }
- model OrganizationStatus {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- name String
- description String?
- organizationId String
- isPublic Boolean @default(false)
- order Int @default(0)
- publicDescription String?
- Conversation Conversation[]
- organization Organization @relation(fields: [organizationId], references: [id])
- authorizedUsers User[] @relation("AuthorizedUsers")
- }
- model FileStatusTrigger {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- requiredFileName String
- description String?
- requiredFileVisibility Visibility
- productStatusId String
- documentType DocumentType @default(OTHER)
- productStatus ProductStatus @relation(fields: [productStatusId], references: [id])
- }
- model WorkflowTrigger {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- workflowId String
- productStatusId String
- productStatus ProductStatus @relation(fields: [productStatusId], references: [id])
- workflow Workflow @relation(fields: [workflowId], references: [id])
- }
- model CheckStatusTrigger {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- fieldName String
- description String?
- formType OrganizationCheckFormType
- options String?
- productStatusId String
- productStatus ProductStatus @relation(fields: [productStatusId], references: [id])
- }
- model ProductClassification {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- name String
- description String?
- condition String?
- productId String
- color String @default("#3b82f7")
- icon String?
- conversationClassifications ConversationClassfication[]
- product Product @relation(fields: [productId], references: [id])
- }
- model ConversationClassfication {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- conversationId String
- classficationId String
- classfication ProductClassification @relation(fields: [classficationId], references: [id])
- conversation Conversation @relation(fields: [conversationId], references: [id])
- }
- model ProductStatus {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- name String
- description String?
- isPublic Boolean @default(false)
- order Int @default(0)
- publicDescription String?
- productId String
- aiInstructions String? @default("")
- initial Boolean @default(false)
- CheckStatusTrigger CheckStatusTrigger[]
- ChoreTrigger ChoreTrigger[]
- factStatusTriggers ClientFactTrigger[]
- Conversation Conversation[]
- fileStatusTriggers FileStatusTrigger[]
- Product Product @relation(fields: [productId], references: [id])
- workflowTriggers WorkflowTrigger[]
- workflow Workflow[] @relation("ProductStatusToWorkflow")
- }
- model Agent {
- id String @id @default(cuid())
- name String
- agentType AgentType
- agentVersion String
- description String
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- imageUrl String?
- products Product[]
- }
- model Application {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- businessName String
- industry String
- creditAmount Float
- loanPurpose String
- businessAddress String
- businessCity String?
- businessState String?
- businessZipCode String?
- ownerMaritalStatus String?
- ssn String
- phoneNo String
- ownershipPercentage Float
- numberOfOwners Int?
- ownerAddress String
- ownerCity String?
- ownerState String?
- ownerZipCode String?
- organizationId String?
- userId String?
- businessWebsite String?
- ownerIsActiveInMilitary Boolean?
- taxPayerIdentificationNumber String?
- conversationId String? @unique
- emailAddress String?
- fullYearsIncorporated Int @default(0)
- lastYearRevenue Float @default(0)
- ownerFirstName String
- ownerLastName String
- pastBankruptcy Boolean?
- womenOwned Boolean?
- yearBeforeRevenue Float @default(0)
- incorporationDate DateTime?
- businessType String?
- conversation Conversation? @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- organization Organization? @relation("OrganizationToApplication", fields: [organizationId], references: [id])
- user User? @relation("ApplicationToUser", fields: [userId], references: [id])
- }
- model Reminders {
- id String @id
- createdAt DateTime @default(now())
- updatedAt DateTime? @default(now()) @updatedAt
- conversationId String
- duration Int @default(0)
- lastLeadEventDate DateTime @default(now())
- triggerDate DateTime
- type ReminderType @default(automatic)
- Conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- }
- model FunctionReminder {
- id String @id
- triggerDate DateTime
- }
- model ClientFact {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- question String
- conversationId String
- RejectionReasoning String?
- Description String?
- fact String?
- statusId String?
- clientFactStatus ClientFileStatus @default(pending)
- Conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- }
- model ClientFactTrigger {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- question String
- description String @default("")
- productStatusId String
- productStatus ProductStatus @relation(fields: [productStatusId], references: [id])
- }
- model Workflow {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- description String?
- url String?
- internal Boolean @default(false)
- name String?
- organizationId String
- slug String?
- type WorkflowType?
- organization Organization @relation(fields: [organizationId], references: [id])
- triggers WorkflowTrigger[]
- statuses ProductStatus[] @relation("ProductStatusToWorkflow")
- }
- model WorkflowFields {
- id String @id(map: "WWorkflowField_pkey") @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- name String
- description String?
- order Int
- dataType FormFieldType
- required Boolean @default(true)
- isInput Boolean @default(false)
- workflowSchemaId String
- options String?
- codeName String?
- entityFieldId String?
- workflowCardId String?
- orderWithinCard Int @default(0)
- validation String?
- values WorkflowFieldValues[]
- tenantEntityField EntityField? @relation(fields: [entityFieldId], references: [id], map: "WWorkflowField_entityFieldId_fkey")
- workflowCard WorkflowCard? @relation(fields: [workflowCardId], references: [id], map: "WWorkflowField_workflowCardId_fkey")
- workflowSchema WorkflowSchema @relation(fields: [workflowSchemaId], references: [id], onDelete: Cascade, map: "WWorkflowField_workflowSchemaId_fkey")
- @@unique([workflowSchemaId, codeName], map: "WWorkflowField_workflowSchemaId_codeName_key")
- }
- model WorkflowFieldValues {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- value String?
- workflowFieldId String
- conversationId String
- pinned Boolean @default(false)
- status displayStatus @default(unknown)
- Conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- WorkflowField WorkflowFields @relation(fields: [workflowFieldId], references: [id], onDelete: Cascade)
- }
- model Attribute {
- id String @id @default(uuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- name String
- type String
- description String?
- enumOptions String[]
- dataType String
- optional Boolean @default(false)
- placeholder String?
- displayName String?
- productId String?
- product Product? @relation(fields: [productId], references: [id])
- values AttributeValue[]
- }
- model AttributeValue {
- id String @id @default(uuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- value String?
- attributeId String
- conversationId String
- status displayStatus @default(unknown)
- pinned Boolean @default(false)
- attribute Attribute @relation(fields: [attributeId], references: [id])
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- @@unique([attributeId, conversationId])
- }
- model Function {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- name String
- description String
- type FunctionType @default(query)
- ActiveFunction ActiveFunction[]
- arguments FunctionArgument[]
- FunctionAction FunctionAction[] @relation("PossibleFollowingFunctions")
- }
- model FunctionArgument {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- name String
- description String
- dataType String
- optional Boolean @default(false)
- enumOptions String[] @default([])
- functionId String
- Function Function @relation(fields: [functionId], references: [id], onDelete: Cascade)
- FunctionArgumentValue FunctionArgumentValue[]
- }
- model ActiveFunction {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- functionId String
- Function Function @relation(fields: [functionId], references: [id])
- FunctionAction FunctionAction[]
- }
- model FunctionAction {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- thought String @default("")
- HILDecision HILDecision @default(PENDING)
- order Int @default(0)
- taskId String
- activeFunctionId String
- systemMessage String @default("")
- status FunctionActionStatus @default(pending)
- metadata Json?
- ActiveFunction ActiveFunction @relation(fields: [activeFunctionId], references: [id])
- FunctionTask FunctionTask @relation(fields: [taskId], references: [id])
- FunctionArgumentValue FunctionArgumentValue[]
- possibleFollowingFunctions Function[] @relation("PossibleFollowingFunctions")
- }
- model FunctionArgumentValue {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- value String?
- actionId String
- argumentId String
- FunctionAction FunctionAction @relation(fields: [actionId], references: [id], onDelete: Cascade)
- FunctionArgument FunctionArgument @relation(fields: [argumentId], references: [id])
- @@unique([actionId, argumentId])
- }
- model FunctionTask {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- completed Boolean @default(false)
- conversationId String?
- caseId String?
- typeMetadata Json?
- type TaskType @default(action)
- FunctionAction FunctionAction[]
- Case Case? @relation(fields: [caseId], references: [id])
- Conversation Conversation? @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- memories Memory[] @relation("FunctionTaskToMemory")
- }
- model Memory {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- type MemoryType
- value String
- conversationId String?
- hierarchy Hierarchy
- role UserRole @default(lead)
- caseId String?
- Case Case? @relation(fields: [caseId], references: [id])
- Conversation Conversation? @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- tasks FunctionTask[] @relation("FunctionTaskToMemory")
- }
- model Log {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- message String
- }
- model Chore {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- description String
- organizationId String
- conversationId String
- isComplete Boolean @default(false)
- completedAt DateTime?
- Conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
- Organization Organization @relation(fields: [organizationId], references: [id])
- users User[] @relation("ChoreToUser")
- @@index([isComplete, conversationId])
- }
- model Document {
- id Int @id @default(autoincrement())
- organizationId String
- title String
- status DocumentStatus @default(DRAFT)
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- s3url String
- completedAt DateTime?
- deletedAt DateTime?
- Organization Organization @relation(fields: [organizationId], references: [id])
- Field Field[]
- Recipient Recipient[]
- }
- model Field {
- id Int @id @default(autoincrement())
- documentId Int?
- type FieldType
- page Int
- positionX Decimal @default(0)
- positionY Decimal @default(0)
- width Decimal @default(-1)
- height Decimal @default(-1)
- customText String?
- inserted Boolean
- recipientId Int?
- Document Document? @relation(fields: [documentId], references: [id], onDelete: Cascade)
- Recipient Recipient? @relation(fields: [recipientId], references: [id])
- Signature Signature?
- @@index([documentId])
- }
- model ChoreTrigger {
- id String @id(map: "choretrigger_pk")
- createdAt DateTime @default(now())
- productStatusId String
- description String
- productStatus ProductStatus @relation(fields: [productStatusId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "choretrigger_productstatus_id_fk")
- users User[] @relation("ChoreTriggerToUser")
- }
- model WorkflowCard {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- order Int @default(0)
- workflowSchemaId String
- name String
- getNextCard String?
- codeName String?
- isFirstCard Boolean @default(false)
- workflowContainerId String?
- workflowContainer WorkflowContainer? @relation(fields: [workflowContainerId], references: [id])
- workflowSchema WorkflowSchema @relation(fields: [workflowSchemaId], references: [id], onDelete: Cascade)
- workflowFields WorkflowFields[]
- @@unique([workflowSchemaId, codeName])
- }
- model WorkflowContainer {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- order Int @default(0)
- workflowSchemaId String
- name String
- codeName String?
- workflowCards WorkflowCard[]
- workflowSchema WorkflowSchema @relation(fields: [workflowSchemaId], references: [id], onDelete: Cascade)
- }
- model WorkflowSchema {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- description String?
- url String?
- internal Boolean @default(false)
- name String
- productId String
- slug String?
- type WorkflowType
- createdById String
- published Boolean @default(false)
- workflowCards WorkflowCard[]
- workflowContainers WorkflowContainer[]
- workflowFields WorkflowFields[]
- user User @relation(fields: [createdById], references: [id])
- product Product @relation(fields: [productId], references: [id])
- workflowSubmissions WorkflowSubmission[]
- }
- model WorkflowSubmission {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now()) @updatedAt
- workflowSchemaId String
- conversationId String
- payload Json
- conversation Conversation @relation(fields: [conversationId], references: [id])
- workflowSchema WorkflowSchema @relation(fields: [workflowSchemaId], references: [id])
- }
- model Entity {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- name String
- description String?
- entityFields EntityField[]
- products Product[] @relation("EntityToProduct")
- }
- model EntityField {
- id String @id @default(cuid())
- name String
- type FieldTypes
- recordHistory Boolean @default(false)
- description String?
- required Boolean @default(false)
- defaultValue String?
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- entityId String
- initActionId String?
- entity Entity @relation(fields: [entityId], references: [id], onDelete: Cascade)
- initAction Action? @relation(fields: [initActionId], references: [id])
- values EntityFieldValue[]
- WorkflowFields WorkflowFields[]
- }
- model EntityFieldValue {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- value String?
- entityFieldId String
- conversationId String?
- organizationId String?
- hierarchy Hierarchy @default(local)
- entityField EntityField @relation(fields: [entityFieldId], references: [id])
- history FieldHistory[]
- @@unique([entityFieldId, conversationId])
- }
- model FieldHistory {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- oldValue String
- newValue String
- entityFieldValueId String
- cause String?
- entityFieldValue EntityFieldValue @relation(fields: [entityFieldValueId], references: [id])
- }
- model Action {
- id String @id @default(cuid())
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- description String?
- ctxExecution String?
- fields EntityField[]
- }
- model Recipient {
- id Int @id @default(autoincrement())
- documentId Int?
- templateId Int?
- email String @db.VarChar(255)
- name String @default("") @db.VarChar(255)
- token String
- expired DateTime?
- signedAt DateTime?
- readStatus ReadStatus @default(NOT_OPENED)
- signingStatus SigningStatus @default(NOT_SIGNED)
- sendStatus SendStatus @default(NOT_SENT)
- createdAt DateTime @default(now())
- updatedAt DateTime @default(now())
- Field Field[]
- Document Document? @relation(fields: [documentId], references: [id], onDelete: Cascade)
- Signature Signature[]
- @@unique([documentId, email])
- @@unique([templateId, email])
- @@index([documentId])
- @@index([templateId])
- @@index([token])
- }
- model Signature {
- id Int @id @default(autoincrement())
- created DateTime @default(now())
- recipientId Int
- fieldId Int @unique
- signatureImageAsBase64 String?
- typedSignature String?
- Field Field @relation(fields: [fieldId], references: [id])
- Recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Cascade)
- @@index([recipientId])
- }
- enum FormFieldType {
- TEXT
- TEXTAREA
- SELECT
- BIG_SELECT
- HEADING
- PARAGRAPH
- SPACER
- CHECKBOX
- NUMBER
- PERCENTAGE
- ZIPCODE
- PHONE_NUMBER
- SSN
- DATE
- CURRENCY
- TIN
- LOCATION
- }
- enum FieldTypes {
- string
- number
- boolean
- date
- time
- dateTime
- email
- phone
- url
- image
- color
- password
- currency
- geolocation
- address
- }
- enum FunctionType {
- query
- mutation
- }
- enum FunctionActionStatus {
- executed
- approved
- rejected
- pending
- executing
- }
- enum HILDecision {
- APPROVED
- REJECTED
- PENDING
- EXECUTED
- }
- enum MemoryType {
- observation
- reflection
- }
- enum Hierarchy {
- local
- global
- }
- enum WorkflowType {
- applicationForm
- }
- enum MessageType {
- client
- agent
- }
- enum ClientFileStatus {
- pending
- processing
- approved
- rejected
- private
- }
- enum Visibility {
- private
- public
- }
- enum CommunicationMedium {
- EMAIL
- PHONE
- SMS
- WHATSAPP
- }
- enum displayStatus {
- confirmed
- mismatch
- unknown
- }
- enum UserRole {
- organizationAdmin
- humanOperator
- admin
- applicant
- lead
- You
- reminder
- }
- enum AgentType {
- LOAN
- CREDIT_CARD
- }
- enum ActionStatus {
- REVIEW_REQUIRED
- PROCESSING
- APPROVED
- ORGANIZATION_REVIEW_REQUIRED
- REMINDER_REVIEW_REQUIRE
- }
- enum OrganizationCheckFormType {
- TEXTAREA
- TEXT
- SELECT
- }
- enum DocumentType {
- BANK_STATEMENT
- PERSONAL_TAX_RETURN
- BUSINESS_TAX_RETURN
- W2_TAX_FORM
- INCOME_STATEMENT
- OTHER
- }
- enum ConversationCheckStatus {
- APPROVED
- REJECTED
- PENDING
- }
- enum Company {
- Microsoft
- Google
- }
- enum TaskType {
- action
- reminder
- }
- enum ReminderType {
- automatic
- heartbeat
- }
- enum DocumentStatus {
- DRAFT
- PENDING
- COMPLETED
- }
- enum FieldType {
- SIGNATURE
- FREE_SIGNATURE
- NAME
- EMAIL
- DATE
- TEXT
- }
- enum ReadStatus {
- NOT_OPENED
- OPENED
- }
- enum SendStatus {
- NOT_SENT
- SENT
- }
- enum SigningStatus {
- NOT_SIGNED
- SIGNED
- }
Add Comment
Please, Sign In to add comment