28 lines
707 B
TypeScript
28 lines
707 B
TypeScript
|
import { date } from 'quasar';
|
||
|
|
||
|
/** An new event does not contain an id and the type might be unset */
|
||
|
export type EditableEvent = Omit<Omit<Omit<FG.Event, 'jobs'>, 'type'>, 'id'> & {
|
||
|
type?: FG.EventType | number;
|
||
|
id?: number;
|
||
|
jobs: EditableJob[];
|
||
|
};
|
||
|
|
||
|
/** A new job does not have an id or type assigned */
|
||
|
export type EditableJob = Omit<Omit<FG.Job, 'type'>, 'id'> & {
|
||
|
type?: FG.EventType | number;
|
||
|
id?: number;
|
||
|
};
|
||
|
|
||
|
export const emptyJob: EditableJob = {
|
||
|
start: new Date(),
|
||
|
end: date.addToDate(new Date(), { hours: 1 }),
|
||
|
services: [],
|
||
|
required_services: 2,
|
||
|
};
|
||
|
|
||
|
export const emptyEvent: EditableEvent = {
|
||
|
start: new Date(),
|
||
|
jobs: [Object.assign({}, emptyJob)],
|
||
|
is_template: false,
|
||
|
};
|