Create MetaData.ts model

This commit is contained in:
Mathias Wagner
2024-07-20 12:32:23 +02:00
parent 329d797380
commit bf48df8b30

42
src/models/MetaData.ts Normal file
View File

@ -0,0 +1,42 @@
import { model, Schema } from "mongoose";
export enum ILicenseMetaType {
TEXT = "TEXT",
NUMBER = "NUMBER",
BOOLEAN = "BOOLEAN"
}
export interface IMetaData {
projectId: string,
type: ILicenseMetaType,
name: string,
description?: string,
defaultValue?: string,
public: boolean
}
const MetaDataSchema = new Schema<IMetaData>({
projectId: {
type: String,
required: true
},
type: {
type: String,
required: true
},
name: {
type: String,
required: true
},
description: {
type: String,
required: true
},
defaultValue: String,
public: {
type: Boolean,
default: false
}
});
export const MetaData = model<IMetaData>("meta", MetaDataSchema);