guesstimate/client/src/models/project.ts

33 lines
590 B
TypeScript

import { Task } 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
createdAt: Date
updatedAt: Date
}
export interface Tasks {
[id: string]: Task
}
export function newProject(id?: string): Project {
return {
id: id ? id : uuidV4(),
label: "",
description: "",
tasks: {},
params: {
...defaults
},
createdAt: new Date(),
updatedAt: new Date(),
};
}