- Introduced new components for form selection and gateway condition management within the process builder. - Implemented a `FormSelector` component for selecting and managing forms, including search functionality and loading states. - Developed a `GatewayConditionManager` component to manage conditions for gateways, allowing users to define and edit conditions visually. - Created a `ProcessBuilderComponents` component to facilitate the addition of core components in the process builder. - Enhanced the `ProcessFlowCanvas` to support new features, including edge selection and improved node management. - Updated the backend API to handle CRUD operations for forms and processes, including error handling for associated tasks. - Integrated new database models for forms and processes in Prisma, ensuring proper relationships and data integrity. - Improved state management in the form builder store to accommodate new features and enhance user experience.
145 lines
5.3 KiB
Plaintext
145 lines
5.3 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
generator jsonSchema {
|
|
provider = "prisma-json-schema-generator"
|
|
output = "./json"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model audit {
|
|
auditID Int @id @default(autoincrement())
|
|
auditIP String? @db.VarChar(255)
|
|
auditURL String? @db.VarChar(255)
|
|
auditURLMethod String? @db.VarChar(255)
|
|
auditURLPayload String? @db.Text
|
|
auditCreatedDate DateTime? @default(now()) @db.DateTime(0)
|
|
auditAction String? @db.VarChar(255)
|
|
auditDetails String? @db.Text
|
|
auditUserID Int?
|
|
auditUsername String? @db.VarChar(255)
|
|
user user? @relation(fields: [auditUserID], references: [userID])
|
|
|
|
@@index([auditUserID], map: "FK_audit_user")
|
|
}
|
|
|
|
model user {
|
|
userID Int @id @default(autoincrement())
|
|
userSecretKey String? @db.VarChar(255)
|
|
userUsername String? @db.VarChar(255)
|
|
userPassword String? @db.VarChar(255)
|
|
userFullName String? @db.VarChar(255)
|
|
userEmail String? @db.VarChar(255)
|
|
userPhone String? @db.VarChar(255)
|
|
userStatus String? @db.VarChar(255)
|
|
userCreatedDate DateTime? @db.DateTime(0)
|
|
userModifiedDate DateTime? @db.DateTime(0)
|
|
audit audit[]
|
|
userrole userrole[]
|
|
processes process[] @relation("ProcessCreator")
|
|
forms form[] @relation("FormCreator")
|
|
assignedTasks task[] @relation("TaskAssignee")
|
|
}
|
|
|
|
model role {
|
|
roleID Int @id @default(autoincrement())
|
|
roleName String? @db.VarChar(255)
|
|
roleDescription String? @db.VarChar(255)
|
|
roleStatus String? @db.VarChar(255)
|
|
roleCreatedDate DateTime? @db.DateTime(0)
|
|
roleModifiedDate DateTime? @db.DateTime(0)
|
|
userrole userrole[]
|
|
}
|
|
|
|
model lookup {
|
|
lookupID Int @id @default(autoincrement())
|
|
lookupOrder Int?
|
|
lookupTitle String? @db.VarChar(255)
|
|
lookupRefCode String? @db.VarChar(255)
|
|
lookupValue String? @db.VarChar(255)
|
|
lookupType String? @db.VarChar(255)
|
|
lookupStatus String? @db.VarChar(255)
|
|
lookupCreatedDate DateTime? @db.DateTime(0)
|
|
lookupModifiedDate DateTime? @db.DateTime(0)
|
|
}
|
|
|
|
model userrole {
|
|
userRoleID Int @id @default(autoincrement())
|
|
userRoleUserID Int @default(0)
|
|
userRoleRoleID Int @default(0)
|
|
userRoleCreatedDate DateTime @db.DateTime(0)
|
|
role role @relation(fields: [userRoleRoleID], references: [roleID], onDelete: NoAction, onUpdate: NoAction, map: "FK_userrole_role")
|
|
user user @relation(fields: [userRoleUserID], references: [userID], onDelete: NoAction, onUpdate: NoAction, map: "FK_userrole_user")
|
|
|
|
@@index([userRoleRoleID], map: "FK_userrole_role")
|
|
@@index([userRoleUserID], map: "FK_userrole_user")
|
|
}
|
|
|
|
// New models for Form Builder
|
|
model form {
|
|
formID Int @id @default(autoincrement())
|
|
formUUID String @unique @db.VarChar(36)
|
|
formName String @db.VarChar(255)
|
|
formDescription String? @db.Text
|
|
formComponents Json @db.Json
|
|
formStatus String @default("active") @db.VarChar(50)
|
|
formCreatedBy Int?
|
|
formCreatedDate DateTime @default(now()) @db.DateTime(0)
|
|
formModifiedDate DateTime? @updatedAt @db.DateTime(0)
|
|
|
|
// Relations
|
|
creator user? @relation("FormCreator", fields: [formCreatedBy], references: [userID])
|
|
formTasks task[] @relation("FormTask")
|
|
|
|
@@index([formCreatedBy], map: "FK_form_creator")
|
|
}
|
|
|
|
// New models for Process Builder
|
|
model process {
|
|
processID Int @id @default(autoincrement())
|
|
processUUID String @unique @db.VarChar(36)
|
|
processName String @db.VarChar(255)
|
|
processDescription String? @db.Text
|
|
processDefinition Json @db.Json
|
|
processVersion Int @default(1)
|
|
processStatus String @default("draft") @db.VarChar(50)
|
|
processCreatedBy Int?
|
|
processCreatedDate DateTime @default(now()) @db.DateTime(0)
|
|
processModifiedDate DateTime? @updatedAt @db.DateTime(0)
|
|
|
|
// Relations
|
|
creator user? @relation("ProcessCreator", fields: [processCreatedBy], references: [userID])
|
|
tasks task[]
|
|
|
|
@@index([processCreatedBy], map: "FK_process_creator")
|
|
}
|
|
|
|
model task {
|
|
taskID Int @id @default(autoincrement())
|
|
taskUUID String @unique @db.VarChar(36)
|
|
taskNodeId String @db.VarChar(255)
|
|
taskName String @db.VarChar(255)
|
|
taskType String @db.VarChar(50)
|
|
taskData Json? @db.Json
|
|
taskProcessId Int
|
|
taskFormId Int?
|
|
taskAssigneeId Int?
|
|
taskStatus String @default("pending") @db.VarChar(50)
|
|
taskCreatedDate DateTime @default(now()) @db.DateTime(0)
|
|
taskModifiedDate DateTime? @updatedAt @db.DateTime(0)
|
|
|
|
// Relations
|
|
process process @relation(fields: [taskProcessId], references: [processID])
|
|
form form? @relation("FormTask", fields: [taskFormId], references: [formID])
|
|
assignee user? @relation("TaskAssignee", fields: [taskAssigneeId], references: [userID])
|
|
|
|
@@index([taskProcessId], map: "FK_task_process")
|
|
@@index([taskFormId], map: "FK_task_form")
|
|
@@index([taskAssigneeId], map: "FK_task_assignee")
|
|
}
|