File tree Expand file tree Collapse file tree 2 files changed +57
-1
lines changed
service/src/tickets/state/_schemas Expand file tree Collapse file tree 2 files changed +57
-1
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'
1+ import { Prop , Schema , SchemaFactory } from '@nestjs/mongoose'
22import { AbstractSchema } from '~/_common/abstracts/schemas/abstract.schema'
3+ import { RulePart , RulePartSchema } from '~/tickets/state/_schemas/parts/rules.part.schema'
34
45@Schema ( {
56 collection : 'states' ,
67 versionKey : false ,
78} )
89export class State 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
956}
1057
1158export const StateSchema = SchemaFactory . createForClass ( State )
You can’t perform that action at this time.
0 commit comments