guesstimate/src/models/project.ts

32 lines
740 B
TypeScript

import { Task, TaskCategory, TaskID } from './task';
import { Params, defaults } from "./params";
import { uuidV4 } from "../util/uuid";
export type ProjectID = string;
export interface Project {
id: ProjectID
label: string
description: string
tasks: Tasks
params: Params
}
export interface Tasks {
[id: string]: Task
}
export function newProject(id?: string): Project {
return {
id: id ? id : uuidV4(),
label: "",
description: "",
tasks: {},
params: {
taskCategories: defaults.taskCategories,
currency: defaults.currency,
roundUpEstimations: defaults.roundUpEstimations,
timeUnit: defaults.timeUnit,
},
};
}