Files
stufflog2/svelte-ui/src/models/goal.ts
T
2021-01-24 12:39:23 +01:00

67 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
}