guesstimate/client/src/models/project.ts

29 lines
566 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: {
...defaults
2020-04-20 11:14:46 +02:00
},
};
}