guesstimate/src/models/project.ts

32 lines
740 B
TypeScript
Raw Normal View History

2020-04-20 11:14:46 +02:00
import { Task, TaskCategory, TaskID } from './task';
import { Params, defaults } from "./params";
2020-04-20 11:14:46 +02:00
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
}
2020-04-20 14:07:26 +02:00
export function newProject(id?: string): Project {
2020-04-20 11:14:46 +02:00
return {
2020-04-20 14:07:26 +02:00
id: id ? id : uuidV4(),
2020-04-20 11:14:46 +02:00
label: "",
description: "",
tasks: {},
params: {
taskCategories: defaults.taskCategories,
2020-04-21 20:45:47 +02:00
currency: defaults.currency,
roundUpEstimations: defaults.roundUpEstimations,
timeUnit: defaults.timeUnit,
2020-04-20 11:14:46 +02:00
},
};
}