diff --git a/common/types/script.ts b/common/types/script.ts new file mode 100644 index 0000000..c9805b4 --- /dev/null +++ b/common/types/script.ts @@ -0,0 +1,5 @@ +export interface Script { + title: string + video: string + body: string +} diff --git a/services/models/script.ts b/services/models/script.ts new file mode 100644 index 0000000..bbc9b3f --- /dev/null +++ b/services/models/script.ts @@ -0,0 +1,11 @@ +import { Script as IScript } from '../../common/types/script' +import { model, Schema, Document } from 'mongoose' + +const ScriptSchema: Record = { + title: { type: String, required: true }, + video: { type: String, required: true }, + body: { type: String, required: true } +} + +export interface ScriptDocument extends Document {} +export const Script = model('Script', new Schema(ScriptSchema))