feat: add initial script implementation
This commit is contained in:
parent
8ee077cb7f
commit
5d649a1e37
5
common/types/script.ts
Normal file
5
common/types/script.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export interface Script {
|
||||||
|
title: string
|
||||||
|
video: string
|
||||||
|
body: string
|
||||||
|
}
|
11
services/models/script.ts
Normal file
11
services/models/script.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { Script as IScript } from '../../common/types/script'
|
||||||
|
import { model, Schema, Document } from 'mongoose'
|
||||||
|
|
||||||
|
const ScriptSchema: Record<keyof IScript, any> = {
|
||||||
|
title: { type: String, required: true },
|
||||||
|
video: { type: String, required: true },
|
||||||
|
body: { type: String, required: true }
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ScriptDocument extends Document<IScript> {}
|
||||||
|
export const Script = model<ScriptDocument>('Script', new Schema<ScriptDocument>(ScriptSchema))
|
Loading…
Reference in a new issue