progress
This commit is contained in:
parent
d70253d6a6
commit
fa645dde92
51 changed files with 657 additions and 281 deletions
|
@ -1,12 +1,13 @@
|
|||
import { Schema, model } from "mongoose";
|
||||
import { PipelineModel, schemaPipeline } from "../pipelines/pipeline_model";
|
||||
import { IsArray, IsOptional, IsString } from "class-validator";
|
||||
import { PipelineValidationModel, schemaPipeline } from "../pipelines/pipeline_model";
|
||||
import { IsArray, IsString } from "class-validator";
|
||||
|
||||
export interface IProjectModel {
|
||||
_id?:string;
|
||||
pipelines: [PipelineModel];
|
||||
_id?: string;
|
||||
pipelines: [PipelineValidationModel];
|
||||
rootDir: string;
|
||||
description: string;
|
||||
isActive:boolean;
|
||||
}
|
||||
|
||||
export const ProjectSchema = new Schema({
|
||||
|
@ -16,23 +17,23 @@ export const ProjectSchema = new Schema({
|
|||
autopopulate: true,
|
||||
default: null,
|
||||
},
|
||||
rootDir: {
|
||||
type: String,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
},
|
||||
isActive: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
}).plugin(require("mongoose-autopopulate"));
|
||||
|
||||
const schema = "Projects";
|
||||
export const projectSchema = "Projects";
|
||||
|
||||
export const ProjectDBModel = model<IProjectModel>(schema, ProjectSchema);
|
||||
export const ProjectDBModel = model<IProjectModel>(projectSchema, ProjectSchema);
|
||||
|
||||
export class ProjectValidationModel {
|
||||
@IsArray()
|
||||
public pipelines: [string];
|
||||
@IsString()
|
||||
public description: string;
|
||||
@IsOptional()
|
||||
public rootDir: string;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue