ChatbotX icon indicating copy to clipboard operation
ChatbotX copied to clipboard

[flows] Can able to CRUD flow

Open realcodesiman opened this issue 1 year ago • 0 comments

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

realcodesiman avatar Jan 23 '25 14:01 realcodesiman