mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-11 10:41:46 +00:00
Create MetaData.ts model
This commit is contained in:
42
src/models/MetaData.ts
Normal file
42
src/models/MetaData.ts
Normal 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);
|
||||||
Reference in New Issue
Block a user