File tree Expand file tree Collapse file tree 2 files changed +59
-5
lines changed
service/src/tickets/source-request/_schemas Expand file tree Collapse file tree 2 files changed +59
-5
lines changed Original file line number Diff line number Diff line change 1+ import { Schema , SchemaFactory } from '@nestjs/mongoose'
2+ import { Document } from 'mongoose'
3+
4+ @Schema ( { _id : false } )
5+ export class RulePart extends Document {
6+
7+ }
8+
9+ export const RulePartSchema = SchemaFactory . createForClass ( RulePart )
Original file line number Diff line number Diff line change 1- import { Schema , SchemaFactory } from '@nestjs/mongoose'
2- import { Document } from 'mongoose'
1+ import { Prop , Schema , SchemaFactory } from '@nestjs/mongoose'
32import { AbstractSchema } from '~/_common/abstracts/schemas/abstract.schema'
4-
5- export type SourceRequestDocument = SourceRequest & Document
3+ import { RulePart , RulePartSchema } from '~/tickets/source-request/_schemas/parts/rules.part.schema'
64
75@Schema ( {
86 collection : 'source-requests' ,
97 versionKey : false ,
108} )
11- export class SourceRequest extends AbstractSchema { }
9+ export class SourceRequest extends AbstractSchema {
10+ @Prop ( {
11+ type : String ,
12+ required : true ,
13+ } )
14+ public name : string
15+
16+ @Prop ( {
17+ type : String ,
18+ required : true ,
19+ } )
20+ public description : string
21+
22+ @Prop ( {
23+ type : String ,
24+ required : true ,
25+ } )
26+ public icon : string
27+
28+ @Prop ( {
29+ type : String ,
30+ required : true ,
31+ } )
32+ public color : string
33+
34+ @Prop ( {
35+ type : [ RulePartSchema ] ,
36+ required : true ,
37+ } )
38+ public rules : RulePart [ ]
39+
40+ @Prop ( {
41+ type : String ,
42+ required : true ,
43+ } )
44+ public backgroundColor : string
45+
46+ @Prop ( {
47+ type : Number ,
48+ required : true ,
49+ } )
50+ public order : number
51+
52+ @Prop ( {
53+ type : Object ,
54+ } )
55+ public customFields : object
56+ }
1257
1358export const SourceRequestSchema = SchemaFactory . createForClass ( SourceRequest )
You can’t perform that action at this time.
0 commit comments