From 4186fb51f66043b221237c7ba91ac5a95a4f32b0 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 2 Dec 2020 02:22:38 +0300 Subject: feat: add log model --- lib/schema.ts | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 lib/schema.ts (limited to 'lib/schema.ts') diff --git a/lib/schema.ts b/lib/schema.ts deleted file mode 100644 index 1bba77d..0000000 --- a/lib/schema.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Schema, Document } from 'mongoose'; - -export interface EventDocument extends Document { - name: string; - schedule: string; - status: 'notStarted' | 'running' | 'complete' | 'failed'; - error?: string; - context: Context; - nextRunAt?: Date; - lastRunAt?: Date; -} - -const createEventSchema = (contextSchema: Schema) => new Schema({ - name: { - type: String, - required: true - }, - schedule: { - type: String, - required: true - }, - status: { - type: String, - default: 'notStarted' - }, - error: String, - context: contextSchema, - nextRunAt: Date, - lastRunAt: Date -}, { timestamps: true }); - - -export default createEventSchema; - -- cgit v1.2.3