2020-04-20 11:14:46 +02:00
|
|
|
import { Task, TaskCategory, TaskID } from './task';
|
2020-04-21 18:44:10 +02:00
|
|
|
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: {
|
2020-04-21 18:44:10 +02:00
|
|
|
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
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|