Files
stufflog2/svelte-ui/src/models/task.ts
T
gisle 62235658eb
continuous-integration/drone/push Build is passing
add item composition in projects.
2021-11-29 21:59:38 +01:00

64 lines
1.3 KiB
TypeScript

import type { IconName } from "../external/icons";
import type Item from "./item";
import type { LogWithSecondaryItem } from "./log";
import type Project from "./project";
export default interface Task {
id: string
itemId: string
projectId: string
itemAmount: number
name: string
description: string
icon: IconName
active: boolean
createdTime: string
endTime?: string
statusTag?: string
}
export interface TaskWithProject extends Task {
project?: Project
}
export interface TaskResult extends Task {
item: Item
logs: LogWithSecondaryItem[]
completedAmount: number
project?: Project
}
// TaskLink is only returned by the API. The tasks are returned transparently.
export interface TaskLink {
taskId: string
projectId: string
}
export interface TaskFilter {
active?: boolean
expiring?: boolean
}
export interface TaskInput {
itemId: string
projectId: string
itemAmount: number
name: string
description: string
active: boolean
endTime?: string | Date
statusTag?: string
}
export interface TaskUpdate {
itemId?: string
itemAmount?: number
name?: string
description?: string
active?: boolean
endTime?: string | Date
clearEndTime?: boolean
statusTag?: string
clearStatusTag?: boolean
projectId?: string
}