import { LineType } from "@/enum";

type LangName = {
  name: 'zh-CN' | 'en',
  value?: string
}

export class Line {
  "endNodeId": string;
  "id": string;
  "lineType": LineType = LineType.STRAIGHT;
  "m": number = 0;
  "memo": string = "";
  "startNodeId": string;
  "useCondition": boolean = false;
  "wfdWorkflowId": string;
}

export class NodeItem {
  "actionLinkId": string;
  "columnLinkId": string;
  "copyLinkId": string;
  "fillLinked": boolean = false;
  "height": number;
  "id": string;
  "imageSrc": string;
  "informLinkId": string;
  "langName": string;
  "name": string;
  "overtimeInformLinkId": string;
  "preProcessorLinkId": string;
  "priority": number = 0;
  "procApproverList": Record<string, any>[] = [];
  "processorLinkId": string;
  "shapeType": number = 0;
  "type": number;
  "wfNodeList": Record<string, any>[];
  "wfdWorkflowId": string;
  "width": number;
  "x": number;
  "y": number;
  langNameList?: LangName[];
}

export class Model {
  "code": string;
  "columnLinkId": string;
  "creationTime": string;
  "creatorUserId": string;
  "displayOrder": number = 0;
  "enableAgentApply": boolean = false;
  "enableAgentApproval": boolean = false;
  "height": number;
  "id": string;
  "informLinkId": string;
  "isDeleted": boolean = false;
  "langName": string;
  "name": string;
  "updateTime": string;
  "wfdCategoryId": string;
  "wfdCategoryName": string;
  "width": number = 0;
  "zoom": number = 0;
}

export class NoteItem {
  "height": number;
  "id": string;
  "imageSrc": "/Content/Lib/des-lib/des/";
  "shapeType": number = 0;
  "text": string;
  "type": number = 1001;
  "wfdWorkflowId": string;
  "width": number;
  "x": number;
  "y": number;
  langTextList?: LangName[];
}

export class WorkFlow {
  lines: Line[] = [];
  nodes: NodeItem[] = [];
  model: Model = new Model();
  objects: NoteItem[] = [];
  points: Record<string, any>[] = [];
}
