import { defineStore } from 'pinia'
const useWorkFlowStore = defineStore(
  'workFlow',
  {
    state: () => ({
      tableId: '',
      isTried: false,
      promoterDrawer: false,
      flowPermission1: {},
      approverDrawer: false,
      approverConfig1: {},
      copyerDrawer: false,
      copyerConfig1: {},
      conditionDrawer: false,
      conditionsConfig1: {
        conditionNodes: [],
      },
    }),
    actions: {
      setTableId(payload: string) {
        this.tableId = payload
      },
      setIsTried(payload: boolean) {
        this.isTried = payload
      },
      setPromoter(payload: boolean) {
        this.promoterDrawer = payload
      },
      setFlowPermission(payload: object) {
        this.flowPermission1 = payload
      },
      setApprover(payload: boolean) {
        this.approverDrawer = payload
      },
      setApproverConfig(payload: object) {
        this.approverConfig1 = payload
      },
      setCopyer(payload: boolean) {
        this.copyerDrawer = payload
      },
      setCopyerConfig(payload: object) {
        this.copyerConfig1 = payload
      },
      setCondition(payload: boolean) {
        this.conditionDrawer = payload
      },
      setConditionsConfig(payload: any) {
        this.conditionsConfig1 = payload
      },
    },
  },
)

export default useWorkFlowStore
