@@ -2,6 +2,7 @@ import { get } from 'lodash';
2
2
import moment from 'moment' ;
3
3
import { ObjectId } from '@lykmapipo/mongoose-common' ;
4
4
import { Predefine } from '@lykmapipo/predefine' ;
5
+ import { DEFAULT_SEEDS } from '@codetanzania/ewea-common' ;
5
6
import { Event } from '@codetanzania/ewea-event' ;
6
7
7
8
import { AUTOPOPULATE_OPTION_PREDEFINE , COUNTRY_CODE } from '../internals' ;
@@ -138,6 +139,94 @@ export const event = {
138
139
default : undefined ,
139
140
} ;
140
141
142
+ /**
143
+ * @name stage
144
+ * @description Currently assigned stage of a case.
145
+ *
146
+ * @memberof Case
147
+ *
148
+ * @type {object }
149
+ * @property {object } type - schema(data) type
150
+ * @property {boolean } required - mark required
151
+ * @property {boolean } index - ensure database index
152
+ * @property {boolean } exists - ensure ref exists before save
153
+ * @property {object } autopopulate - auto populate(eager loading) options
154
+ * @property {boolean } taggable - allow field use for tagging
155
+ * @property {boolean } exportable - allow field use for exporting
156
+ * @property {boolean } aggregatable - allow field use for aggregation
157
+ * @property {boolean } default - default value set when none provided
158
+ * @property {object } fake - fake data generator options
159
+ *
160
+ * @author lally elias <lallyelias87@gmail.com>
161
+ * @since 0.4.0
162
+ * @version 0.1.0
163
+ * @instance
164
+ * @example
165
+ * {
166
+ * _id: '5dde6ca23631a92c2d616250',
167
+ * strings: { name: { en: 'Confirmed' } },
168
+ * }
169
+ */
170
+ export const stage = {
171
+ type : ObjectId ,
172
+ ref : Predefine . MODEL_NAME ,
173
+ // required: true,
174
+ index : true ,
175
+ exists : true ,
176
+ aggregatable : { unwind : true } ,
177
+ autopopulate : AUTOPOPULATE_OPTION_PREDEFINE ,
178
+ taggable : true ,
179
+ exportable : {
180
+ format : ( v ) => get ( v , 'strings.name.en' ) ,
181
+ default : 'NA' ,
182
+ } ,
183
+ default : DEFAULT_SEEDS . CaseStage ,
184
+ } ;
185
+
186
+ /**
187
+ * @name severity
188
+ * @description Currently assigned severity of a case.
189
+ *
190
+ * @memberof Case
191
+ *
192
+ * @type {object }
193
+ * @property {object } type - schema(data) type
194
+ * @property {boolean } required - mark required
195
+ * @property {boolean } index - ensure database index
196
+ * @property {boolean } exists - ensure ref exists before save
197
+ * @property {object } autopopulate - auto populate(eager loading) options
198
+ * @property {boolean } taggable - allow field use for tagging
199
+ * @property {boolean } exportable - allow field use for exporting
200
+ * @property {boolean } aggregatable - allow field use for aggregation
201
+ * @property {boolean } default - default value set when none provided
202
+ * @property {object } fake - fake data generator options
203
+ *
204
+ * @author lally elias <lallyelias87@gmail.com>
205
+ * @since 0.4.0
206
+ * @version 0.1.0
207
+ * @instance
208
+ * @example
209
+ * {
210
+ * _id: '5dde6ca23631a92c2d616250',
211
+ * strings: { name: { en: 'Extreme' } },
212
+ * }
213
+ */
214
+ export const severity = {
215
+ type : ObjectId ,
216
+ ref : Predefine . MODEL_NAME ,
217
+ // required: true,
218
+ index : true ,
219
+ exists : true ,
220
+ aggregatable : { unwind : true } ,
221
+ autopopulate : AUTOPOPULATE_OPTION_PREDEFINE ,
222
+ taggable : true ,
223
+ exportable : {
224
+ format : ( v ) => get ( v , 'strings.name.en' ) ,
225
+ default : 'NA' ,
226
+ } ,
227
+ default : DEFAULT_SEEDS . CaseSeverity ,
228
+ } ;
229
+
141
230
/**
142
231
* @name number
143
232
* @description Human readable, unique identifier of a case.
0 commit comments