aboutsummaryrefslogtreecommitdiff
path: root/lib/schema.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-12-02 02:22:38 +0300
committereug-vs <eug-vs@keemail.me>2020-12-02 02:22:38 +0300
commit4186fb51f66043b221237c7ba91ac5a95a4f32b0 (patch)
tree71657f367d899d0fbc165b3c50197d81b8d69007 /lib/schema.ts
parentf6c5ac6632781d813a6e1f1ba957e7f9e4d70738 (diff)
downloadmongo-cronjob-4186fb51f66043b221237c7ba91ac5a95a4f32b0.tar.gz
feat: add log model
Diffstat (limited to 'lib/schema.ts')
-rw-r--r--lib/schema.ts34
1 files changed, 0 insertions, 34 deletions
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<Context> 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;
-