You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.3 KiB
67 lines
1.3 KiB
import type Group from "./group";
|
|
import type Item from "./item";
|
|
import type { LogResult } from "./log";
|
|
|
|
export type GoalCompositionMode = "task" | "item"
|
|
|
|
export default interface Goal {
|
|
id: string
|
|
groupId: string
|
|
itemId?: string
|
|
startTime: string
|
|
endTime: string
|
|
amount: number
|
|
name: string
|
|
description: string
|
|
unweighted: boolean
|
|
compositionMode: GoalCompositionMode
|
|
taskFilter?: string
|
|
itemFilter?: string
|
|
}
|
|
|
|
export interface GoalFilter {
|
|
minTime?: Date
|
|
maxTime?: Date
|
|
includesTime?: Date
|
|
}
|
|
|
|
export interface GoalResult extends Goal {
|
|
group: Group
|
|
items: GoalResultItem[]
|
|
logs: LogResult[]
|
|
completedAmount: number
|
|
}
|
|
|
|
interface GoalResultItem extends Item {
|
|
completedAmount: number
|
|
}
|
|
|
|
export interface GoalInput {
|
|
groupId: string
|
|
itemId: string
|
|
startTime: string | Date
|
|
endTime: string | Date
|
|
amount: number
|
|
name: string
|
|
description: string
|
|
unweighted: boolean
|
|
compositionMode: string
|
|
taskFilter?: string
|
|
itemFilter?: string
|
|
}
|
|
|
|
export interface GoalUpdate {
|
|
itemId?: string
|
|
startTime?: string | Date
|
|
endTime?: string | Date
|
|
amount?: number
|
|
name?: string
|
|
description?: string
|
|
unweighted?: boolean
|
|
compositionMode?: string
|
|
clearItemId?: boolean
|
|
taskFilter?: string
|
|
clearTaskFilter: boolean
|
|
itemFilter?: string
|
|
clearItemFilter: boolean
|
|
}
|