chore: improve convention entry <> event

This commit is contained in:
Carlos Valente
2025-04-17 12:40:32 +02:00
committed by Carlos Valente
parent 4180d0a337
commit 166be66ce3
28 changed files with 245 additions and 245 deletions
+5 -5
View File
@@ -18,7 +18,7 @@ import {
OntimeBlock,
OntimeEvent,
Rundown,
SupportedEvent,
SupportedEntry,
TimerType,
TimeStrategy,
} from 'ontime-types';
@@ -232,10 +232,10 @@ export const parseExcel = (
const maybeTimeType = makeString(column, '');
if (maybeTimeType === 'block') {
// we leave this as a clue for the object filtering later on
entry.type = SupportedEvent.Block;
entry.type = SupportedEntry.Block;
} else if (maybeTimeType === '' || maybeTimeType === 'event' || isKnownTimerType(maybeTimeType)) {
// @ts-expect-error -- we leave this as a clue for the object filtering later on
entry.type = SupportedEvent.Event;
entry.type = SupportedEntry.Event;
entry.timerType = validateTimerType(maybeTimeType);
} else {
// if it is not a block or a known type, we dont import it
@@ -320,7 +320,7 @@ export const parseExcel = (
const event = {
...entry,
custom: { ...entryCustomFields },
type: SupportedEvent.Event,
type: SupportedEntry.Event,
} as OntimeEvent;
if (timerTypeIndex === null) {
@@ -407,7 +407,7 @@ export function createPatch(originalEvent: OntimeEvent, patchEvent: Partial<Onti
return {
id: originalEvent.id,
type: SupportedEvent.Event,
type: SupportedEntry.Event,
title: makeString(patchEvent.title, originalEvent.title),
timeStart,
timeEnd,