import type { ProjectCustomField } from "./CustomFields"; import type { DurationPresentation } from "../utils"; import type { EntityBase } from "./Entity"; import type { Project } from "./Project"; import type { Issue } from "./Issue"; import type { User } from "./User"; export type WorkItemAttribute = EntityBase<"WorkItemAttribute"> & { workItem: BaseWorkItem | null; projectAttribute: WorkItemProjectAttribute; value: WorkItemAttributeValue | null; name: string; }; export type BaseWorkItem = IssueWorkItem; export type IssueWorkItem = EntityBase<"IssueWorkItem"> & { author: User | null; creator: User | null; text: string | null; textPreview: string; type: WorkItemType | null; created: number | null; updated: number | null; duration: DurationValue; date: number; issue: Issue; attributes: WorkItemAttribute[]; }; export type WorkItemType = EntityBase<"WorkItemType"> & { name: string | null; autoAttached: boolean; }; export type DurationValue = EntityBase<"DurationValue"> & { minutes: number; presentation: DurationPresentation; }; export type WorkItemProjectAttribute = EntityBase<"WorkItemProjectAttribute"> & { timeTrackingSettings: ProjectTimeTrackingSettings | null; prototype: WorkItemAttributePrototype | null; values: WorkItemAttributeValue[]; name: string | null; ordinal: number; }; export type ProjectTimeTrackingSettings = EntityBase<"ProjectTimeTrackingSettings"> & { enabled: boolean; estimate: ProjectCustomField | null; timeSpent: ProjectCustomField | null; workItemTypes: WorkItemType[]; project: Project | null; attributes: WorkItemProjectAttribute[]; }; export type GlobalTimeTrackingSettings = EntityBase<"GlobalTimeTrackingSettings"> & { workItemTypes: WorkItemType[]; workTimeSettings: WorkTimeSettings; attributePrototypes: WorkItemAttributePrototype[]; }; export type WorkTimeSettings = EntityBase<"WorkTimeSettings"> & { minutesADay: number; workDays: number[]; firstDayOfWeek: number; daysAWeek: number; }; export type WorkItemAttributeValue = EntityBase<"WorkItemAttributeValue"> & { name: string | null; description: string | null; autoAttach: boolean; prototype: WorkItemAttributePrototype | null; }; export type WorkItemAttributePrototype = EntityBase<"WorkItemAttributePrototype"> & { name: string | null; instances: WorkItemProjectAttribute[]; values: WorkItemAttributeValue[]; };