guesstimate/src/models/project.ts

35 lines
772 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: "€",
roundUpEstimations: true,
timeUnit: {
label: "Jour/homme",
acronym: "j/h",
}
},
};
}