import { FormDataBody } from '../dto/taskService.dto'; import { Member } from './memberService.type'; import { DropdownOption } from './options.type'; import { Project } from './projectService.type'; import { ProjectModule } from './projectModuleService.type'; import { ProjectProcess } from './projectProcessService.type'; import { ShortProjectSubModule } from './projectSubModuleService.type'; import { WangsitStatus } from './wangsStatus.type'; import { JSONContent } from './timeline.type'; import { ChildGroup } from './dataTable.type'; import { Pbi } from './projectPbi.type'; export interface TaskOptions { project?: string; module?: string; subModule?: string; pbi?: string; excludePbi?: string; status?: string; member?: string; task?: string; memberOptions?: boolean; projectOptions?: boolean; moduleOptions?: boolean; taskOptions?: boolean; subModuleOptions?: boolean; processOptions?: boolean; } export type ApiSpecLog = { event: string; user: { _id: string; fullName: string; nickName: string; }; date: string; taskId: string; }; export type ApiSpecLogList = Record; export type TaskDetailData = { _id: string; project: Project; process: ProjectProcess; module: ProjectModule; subModule: ShortProjectSubModule; productBacklogItem?: Pick; repository: string; sonarqube?: string; name: string; assignedTo: Member[]; team: string[]; status: WangsitStatus; priority: number | null; timeReportedBug: number; startDate: Date | null; finishedDate: Date | null; duration: number | null; timerStartedAt: string | null; timerStartedValue: number | null; approvalStatus: string; }; export type TaskDescription = { _id: string; description: string | null; updatedBy: Member | null; updatedAt: string | Date | null; }; export type TaskChildren = { process?: Pick; module?: Pick; subModule?: Pick; tasks?: TaskDependencyDetail[]; options?: DropdownOption[]; selectedOptions?: string[]; }; export type TaskDependency = { process?: Pick; module?: Pick; subModule?: Pick; task?: TaskDependencyDetail[]; options?: DropdownOption[]; selectedOptions?: string[]; loading?: boolean; custom?: boolean; processOptions?: DropdownOption[]; moduleOptions?: DropdownOption[]; subModuleOptions?: DropdownOption[]; subModuleVisibility?: boolean; }; export type TaskDependencyDetail = { _id: string; name: string; assignedTo: Member[]; status: WangsitStatus; taskLink: TaskLink; caption: string; showCaption?: boolean; }; export type TaskLinkType = 'task' | 'service'; export type TaskLinkURLType = 'url' | 'embedded'; export type TaskLink = { _id: string; type: TaskLinkType; link: string; linkType: TaskLinkURLType; updatedBy: Member; createdAt: string | Date; updatedAt: string | Date; }; export type TaskChecklist = { _id: string; name: string; task: string; caption?: string; checklistItems?: TaskChecklistItem[]; showRenameChecklist?: boolean; showAddItem?: boolean; isRequested?: boolean; }; export type TaskChecklistItem = { _id: string; name: string; checked: boolean; updatedBy?: { _id: string; fullName: string; nickName: string; }; isRequested: boolean; checkedAt?: string; caption?: string; createdAt: string; updatedAt: string; attachments: unknown[]; showRenameItem?: boolean; showCaptionItem?: boolean; content?: JSONContent; key?: number; }; export type TaskChecklistTemplate = { _id: string; project: string; name: string; module: string; subModule: string; task: string; items: string[]; createdBy: Member; createdAt: string; updatedAt: string; }; export interface TaskAPI { _id: string; name: string; header?: string; url?: string; method?: string; query?: string[]; contentType: string; jsonBody?: string; formDataBody?: FormDataBody[]; response?: string; isIntact?: boolean; isSuccess?: boolean; updatedBy: Member; updatedAt: string; anyChanges?: boolean; } export type FormDataBodyCustom = Omit & { isMandatory: 'ya' | 'tidak'; }; export type TaskAPIFormDataCustom = Omit & { formDataBody: FormDataBodyCustom[]; }; export interface TaskReview { _id: string; task: string; user: Member; title: string; content?: string; checklists?: TaskReviewChecklist[]; createdAt: string; updatedAt: string; } interface TaskReviewChecklist { name: string; items: TaskReviewChecklistItem[]; } interface TaskReviewChecklistItem { name: string; result: 'Ok' | 'Bug'; content?: string; } export type TaskType = 'parent' | 'child' | 'dependency'; export interface TaskTableItem { _id: string; project: Project; process: ProjectProcess; module: ProjectModule; subModule: ShortProjectSubModule; name: string; assignedTo: Member[]; team: string[]; status: string; priority?: number; timeReportedBug: number; childTask: number; dependency: TaskTableItemDependency; exportDependencyField?: string; lastUpdatedAt: string; children?: ChildGroup[]; hasChildren?: boolean; taskType?: TaskType; isProjectManager?: boolean; isTeamLeader?: boolean; } export interface TaskTableItemDependency { done: number; onProgress: number; } export interface TaskTableOptionQuery { projectOptions?: boolean; moduleOptions?: boolean; subModuleOptions?: boolean; memberOptions?: boolean; taskOptions?: boolean; processOptions?: boolean; project?: string; module?: string; subModule?: string; } export interface TaskTableFamily { dependencies: TaskTableItem[]; children: TaskTableItem[]; } export interface TaskTableFamilyResponse { status: number; message: string; data: TaskTableFamily; } export interface TaskAttachmentChangelogItem { _id: string; type: string; attachmentSrc: string; attachment: string; action: string; user: Member; createdAt: string; updatedAt: string; } export interface TaskLinkChangelogItem { _id: string; type: TaskLinkType; action: string; oldValue: TaskLinkChangelogItemValue; newValue: TaskLinkChangelogItemValue; user: Member; createdAt: string; updatedAt: string; } export interface TaskLinkChangelogItemValue { type: TaskLinkURLType; link: string; } export interface TaskChecklistChangelogItem { _id: string; task: string; action: string; oldValue: string; newValue: string; attachment: { type: string; name: string; src: string; }; user: Member; createdAt: string; updatedAt: string; } export interface Task { _id: string; process: Entity; subModule: Entity; project: Projects; module: Module; name: string; assignedTo: User[]; team: string[]; status: string; childTask: number; timeReportedBug: number; dependency: Dependency; } export interface Entity { _id: string; name: string; } export interface Projects extends Entity { initial: string; } export interface Module extends Entity { initial: string; } export interface User { _id: string; fullName: string; nickName: string; key: number; profilePictureBig: string; profilePictureMedium: string; profilePictureSmall: string; } export interface Dependency { done: number; onProgress: number; } export {};