ChatbotX
ChatbotX copied to clipboard
[flows] Can able to CRUD flow
DoD
Make the below functions:
- list flows
- create new flow
- view flow
- edit flow
- delete flow (move to trash)
- permanet delete flow (remove from trash)
Database
Flow {
id cuid2
createdAt datetime
updatedAt datetime
chatbotId string
userId string
folderId String?
isPublished Boolean
enableInInbox Boolean
currentVersionId // can switch version, this will save FlowVersion
}
FlowVersion {
id cuid2
createdAt datetime
updatedAt datetime
chatbotId string
flowId string
title string
nodes json
edges json
version Datetime
isDraft boolean
}
check self relation https://www.prisma.io/docs/orm/prisma-schema/data-model/relations/self-relations#one-to-many-self-relations