tabletcommand-backend-models 5.26.0 → 5.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/models/schema/validation-error-item.js +35 -0
- package/build/models/schema/validation-error-item.js.map +1 -0
- package/build/models/validation-report.js +64 -0
- package/build/models/validation-report.js.map +1 -0
- package/definitions/index.d.ts +2 -0
- package/definitions/index.d.ts.map +1 -1
- package/definitions/models/schema/validation-error-item.d.ts +28 -0
- package/definitions/models/schema/validation-error-item.d.ts.map +1 -0
- package/definitions/models/validation-report.d.ts +384 -0
- package/definitions/models/validation-report.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/models/schema/validation-error-item.ts +38 -0
- package/src/models/validation-report.ts +73 -0
- package/test/0index.js +2 -0
- package/test/department.js +1 -1
- package/test/mock.js +52 -24
- package/test/validation-report.js +34 -0
package/build/index.js
CHANGED
|
@@ -62,6 +62,7 @@ async function wireModels(mongoose) {
|
|
|
62
62
|
User: await getModel(Promise.resolve().then(() => require("./models/user"))),
|
|
63
63
|
UserDevice: await getModel(Promise.resolve().then(() => require("./models/user-device"))),
|
|
64
64
|
UserRegistration: await getModel(Promise.resolve().then(() => require("./models/user-registration"))),
|
|
65
|
+
ValidationReport: await getModel(Promise.resolve().then(() => require("./models/validation-report"))),
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
68
|
__exportStar(require("./helpers"), exports);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,KAAK,UAAU,UAAU,CAAC,QAAwB;IAEhD,KAAK,UAAU,QAAQ,CAAoE,CAAmB;QAC5G,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAg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;AAEnB,KAAK,UAAU,OAAO,CAAC,GAAW;IACvC,MAAM,QAAQ,GAAG,2CAAa,UAAU,EAAC,CAAC;IAC1C,QAAQ,CAAC,OAAO,GAAG,2CAAa,UAAU,EAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG;QACX,eAAe,EAAE,IAAI;QACrB,kBAAkB,EAAE,IAAI;KACzB,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAErD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;AAC1C,CAAC;AAZD,0BAYC;AAID,kBAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const helpers_1 = require("../../helpers");
|
|
4
|
+
function ValidationErrorItemSchema(mongoose) {
|
|
5
|
+
const { Schema } = mongoose;
|
|
6
|
+
const Item = (0, helpers_1.createSchema)(Schema, {
|
|
7
|
+
message: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "",
|
|
10
|
+
},
|
|
11
|
+
firstSeenAt: {
|
|
12
|
+
type: Date,
|
|
13
|
+
default: helpers_1.currentDate,
|
|
14
|
+
},
|
|
15
|
+
lastSeenAt: {
|
|
16
|
+
type: Date,
|
|
17
|
+
default: helpers_1.currentDate,
|
|
18
|
+
},
|
|
19
|
+
clearedAt: {
|
|
20
|
+
type: Date,
|
|
21
|
+
default: undefined,
|
|
22
|
+
},
|
|
23
|
+
// Req Body
|
|
24
|
+
payload: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: {}
|
|
27
|
+
},
|
|
28
|
+
}, {
|
|
29
|
+
_id: false,
|
|
30
|
+
id: false,
|
|
31
|
+
});
|
|
32
|
+
return Item;
|
|
33
|
+
}
|
|
34
|
+
exports.default = ValidationErrorItemSchema;
|
|
35
|
+
//# sourceMappingURL=validation-error-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-error-item.js","sourceRoot":"","sources":["../../../src/models/schema/validation-error-item.ts"],"names":[],"mappings":";;AAAA,2CAIuB;AAEvB,SAAwB,yBAAyB,CAAC,QAAwB;IACxE,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAE5B,MAAM,IAAI,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QAChC,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,WAAW,EAAE;YACX,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,SAAS;SACnB;QACD,WAAW;QACX,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;KACF,EAAE;QACD,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,KAAK;KACV,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AA/BD,4CA+BC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidationReportModule = exports.ValidationReportSchema = void 0;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
const validation_error_item_1 = require("./schema/validation-error-item");
|
|
6
|
+
function ValidationReportSchema(mongoose) {
|
|
7
|
+
const { Schema, Types } = mongoose;
|
|
8
|
+
const ValidationErrorItem = (0, validation_error_item_1.default)(mongoose);
|
|
9
|
+
const modelSchema = (0, helpers_1.createSchema)(Schema, {
|
|
10
|
+
_id: {
|
|
11
|
+
type: Types.ObjectId,
|
|
12
|
+
auto: true,
|
|
13
|
+
},
|
|
14
|
+
departmentId: {
|
|
15
|
+
type: Types.ObjectId,
|
|
16
|
+
ref: "Department",
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
location: {
|
|
20
|
+
type: [ValidationErrorItem],
|
|
21
|
+
default: [],
|
|
22
|
+
},
|
|
23
|
+
statusMap: {
|
|
24
|
+
type: [ValidationErrorItem],
|
|
25
|
+
default: [],
|
|
26
|
+
},
|
|
27
|
+
status: {
|
|
28
|
+
type: [ValidationErrorItem],
|
|
29
|
+
default: [],
|
|
30
|
+
},
|
|
31
|
+
vehicleStatus: {
|
|
32
|
+
type: [ValidationErrorItem],
|
|
33
|
+
default: [],
|
|
34
|
+
},
|
|
35
|
+
vehicle: {
|
|
36
|
+
type: [ValidationErrorItem],
|
|
37
|
+
default: [],
|
|
38
|
+
},
|
|
39
|
+
incident: {
|
|
40
|
+
type: [ValidationErrorItem],
|
|
41
|
+
default: [],
|
|
42
|
+
},
|
|
43
|
+
personnel: {
|
|
44
|
+
type: [ValidationErrorItem],
|
|
45
|
+
default: [],
|
|
46
|
+
},
|
|
47
|
+
modified: {
|
|
48
|
+
type: Date,
|
|
49
|
+
default: helpers_1.currentDate,
|
|
50
|
+
},
|
|
51
|
+
}, {
|
|
52
|
+
collection: "massive_validation_report",
|
|
53
|
+
});
|
|
54
|
+
modelSchema.set("autoIndex", false);
|
|
55
|
+
return modelSchema;
|
|
56
|
+
}
|
|
57
|
+
exports.ValidationReportSchema = ValidationReportSchema;
|
|
58
|
+
async function ValidationReportModule(mongoose) {
|
|
59
|
+
const modelSchema = ValidationReportSchema(mongoose);
|
|
60
|
+
return (0, helpers_1.createModel)(mongoose, "ValidationReport", modelSchema);
|
|
61
|
+
}
|
|
62
|
+
exports.ValidationReportModule = ValidationReportModule;
|
|
63
|
+
exports.default = ValidationReportModule;
|
|
64
|
+
//# sourceMappingURL=validation-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AAC,CAAC;IACH,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAEpC,OAAO,WAAW,CAAC;AACrB,CAAC;AApDD,wDAoDC;AAEM,KAAK,UAAU,sBAAsB,CAAC,QAAwB;IACnE,MAAM,WAAW,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACrD,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;AAChE,CAAC;AAHD,wDAGC;AAID,kBAAe,sBAAsG,CAAC"}
|
package/definitions/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { Template, TemplateModel } from "./models/template";
|
|
|
40
40
|
export { User, UserModel } from "./models/user";
|
|
41
41
|
export { UserDevice, UserDeviceModel } from "./models/user-device";
|
|
42
42
|
export { UserRegistration, UserRegistrationModel } from "./models/user-registration";
|
|
43
|
+
export { ValidationReport, ValidationReportModel } from "./models/validation-report";
|
|
43
44
|
export * from "./helpers";
|
|
44
45
|
export declare function connect(url: string): Promise<{
|
|
45
46
|
mongoose: typeof import("mongoose");
|
|
@@ -86,6 +87,7 @@ export declare function connect(url: string): Promise<{
|
|
|
86
87
|
User: import("./models/user").UserModel;
|
|
87
88
|
UserDevice: import("./models/user-device").UserDeviceModel;
|
|
88
89
|
UserRegistration: import("./models/user-registration").UserRegistrationModel;
|
|
90
|
+
ValidationReport: import("./models/validation-report").ValidationReportModel;
|
|
89
91
|
};
|
|
90
92
|
}>;
|
|
91
93
|
declare type UnboxPromise<T extends Promise<unknown>> = T extends Promise<infer U> ? U : never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAuDA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EA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EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAErF,cAAc,WAAW,CAAC;AAE1B,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAYxC;AAED,aAAK,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACvF,oBAAY,aAAa,GAAG,YAAY,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC/E,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="mongoose" />
|
|
2
|
+
import { MongooseModule, currentDate } from "../../helpers";
|
|
3
|
+
export default function ValidationErrorItemSchema(mongoose: MongooseModule): import("mongoose").Schema<any> & {
|
|
4
|
+
_interface: import("../../helpers").MongooseInterface<{
|
|
5
|
+
message: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
firstSeenAt: {
|
|
10
|
+
type: DateConstructor;
|
|
11
|
+
default: typeof currentDate;
|
|
12
|
+
};
|
|
13
|
+
lastSeenAt: {
|
|
14
|
+
type: DateConstructor;
|
|
15
|
+
default: typeof currentDate;
|
|
16
|
+
};
|
|
17
|
+
clearedAt: {
|
|
18
|
+
type: DateConstructor;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
payload: {
|
|
22
|
+
type: ObjectConstructor;
|
|
23
|
+
default: {};
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
_methods: unknown;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=validation-error-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-error-item.d.ts","sourceRoot":"","sources":["../../../src/models/schema/validation-error-item.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EAEd,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;EA+BzE"}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/// <reference types="mongoose" />
|
|
2
|
+
import { currentDate, ItemTypeFromTypeSchemaFunction, ModelTypeFromTypeSchemaFunction, MongooseModule, ReplaceModelReturnType } from "../helpers";
|
|
3
|
+
export declare function ValidationReportSchema(mongoose: MongooseModule): import("mongoose").Schema<any> & {
|
|
4
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
5
|
+
_id: {
|
|
6
|
+
type: import("mongoose").Types.ObjectIdConstructor;
|
|
7
|
+
auto: boolean;
|
|
8
|
+
};
|
|
9
|
+
departmentId: {
|
|
10
|
+
type: import("mongoose").Types.ObjectIdConstructor;
|
|
11
|
+
ref: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
};
|
|
14
|
+
location: {
|
|
15
|
+
type: (import("mongoose").Schema<any> & {
|
|
16
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
17
|
+
message: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
firstSeenAt: {
|
|
22
|
+
type: DateConstructor;
|
|
23
|
+
default: typeof currentDate;
|
|
24
|
+
};
|
|
25
|
+
lastSeenAt: {
|
|
26
|
+
type: DateConstructor;
|
|
27
|
+
default: typeof currentDate;
|
|
28
|
+
};
|
|
29
|
+
clearedAt: {
|
|
30
|
+
type: DateConstructor;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
payload: {
|
|
34
|
+
type: ObjectConstructor;
|
|
35
|
+
default: {};
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
_methods: unknown;
|
|
39
|
+
})[];
|
|
40
|
+
default: never[];
|
|
41
|
+
};
|
|
42
|
+
statusMap: {
|
|
43
|
+
type: (import("mongoose").Schema<any> & {
|
|
44
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
45
|
+
message: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
firstSeenAt: {
|
|
50
|
+
type: DateConstructor;
|
|
51
|
+
default: typeof currentDate;
|
|
52
|
+
};
|
|
53
|
+
lastSeenAt: {
|
|
54
|
+
type: DateConstructor;
|
|
55
|
+
default: typeof currentDate;
|
|
56
|
+
};
|
|
57
|
+
clearedAt: {
|
|
58
|
+
type: DateConstructor;
|
|
59
|
+
default: undefined;
|
|
60
|
+
};
|
|
61
|
+
payload: {
|
|
62
|
+
type: ObjectConstructor;
|
|
63
|
+
default: {};
|
|
64
|
+
};
|
|
65
|
+
}>;
|
|
66
|
+
_methods: unknown;
|
|
67
|
+
})[];
|
|
68
|
+
default: never[];
|
|
69
|
+
};
|
|
70
|
+
status: {
|
|
71
|
+
type: (import("mongoose").Schema<any> & {
|
|
72
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
73
|
+
message: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
firstSeenAt: {
|
|
78
|
+
type: DateConstructor;
|
|
79
|
+
default: typeof currentDate;
|
|
80
|
+
};
|
|
81
|
+
lastSeenAt: {
|
|
82
|
+
type: DateConstructor;
|
|
83
|
+
default: typeof currentDate;
|
|
84
|
+
};
|
|
85
|
+
clearedAt: {
|
|
86
|
+
type: DateConstructor;
|
|
87
|
+
default: undefined;
|
|
88
|
+
};
|
|
89
|
+
payload: {
|
|
90
|
+
type: ObjectConstructor;
|
|
91
|
+
default: {};
|
|
92
|
+
};
|
|
93
|
+
}>;
|
|
94
|
+
_methods: unknown;
|
|
95
|
+
})[];
|
|
96
|
+
default: never[];
|
|
97
|
+
};
|
|
98
|
+
vehicleStatus: {
|
|
99
|
+
type: (import("mongoose").Schema<any> & {
|
|
100
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
101
|
+
message: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
firstSeenAt: {
|
|
106
|
+
type: DateConstructor;
|
|
107
|
+
default: typeof currentDate;
|
|
108
|
+
};
|
|
109
|
+
lastSeenAt: {
|
|
110
|
+
type: DateConstructor;
|
|
111
|
+
default: typeof currentDate;
|
|
112
|
+
};
|
|
113
|
+
clearedAt: {
|
|
114
|
+
type: DateConstructor;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
payload: {
|
|
118
|
+
type: ObjectConstructor;
|
|
119
|
+
default: {};
|
|
120
|
+
};
|
|
121
|
+
}>;
|
|
122
|
+
_methods: unknown;
|
|
123
|
+
})[];
|
|
124
|
+
default: never[];
|
|
125
|
+
};
|
|
126
|
+
vehicle: {
|
|
127
|
+
type: (import("mongoose").Schema<any> & {
|
|
128
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
129
|
+
message: {
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
firstSeenAt: {
|
|
134
|
+
type: DateConstructor;
|
|
135
|
+
default: typeof currentDate;
|
|
136
|
+
};
|
|
137
|
+
lastSeenAt: {
|
|
138
|
+
type: DateConstructor;
|
|
139
|
+
default: typeof currentDate;
|
|
140
|
+
};
|
|
141
|
+
clearedAt: {
|
|
142
|
+
type: DateConstructor;
|
|
143
|
+
default: undefined;
|
|
144
|
+
};
|
|
145
|
+
payload: {
|
|
146
|
+
type: ObjectConstructor;
|
|
147
|
+
default: {};
|
|
148
|
+
};
|
|
149
|
+
}>;
|
|
150
|
+
_methods: unknown;
|
|
151
|
+
})[];
|
|
152
|
+
default: never[];
|
|
153
|
+
};
|
|
154
|
+
incident: {
|
|
155
|
+
type: (import("mongoose").Schema<any> & {
|
|
156
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
157
|
+
message: {
|
|
158
|
+
type: StringConstructor;
|
|
159
|
+
default: string;
|
|
160
|
+
};
|
|
161
|
+
firstSeenAt: {
|
|
162
|
+
type: DateConstructor;
|
|
163
|
+
default: typeof currentDate;
|
|
164
|
+
};
|
|
165
|
+
lastSeenAt: {
|
|
166
|
+
type: DateConstructor;
|
|
167
|
+
default: typeof currentDate;
|
|
168
|
+
};
|
|
169
|
+
clearedAt: {
|
|
170
|
+
type: DateConstructor;
|
|
171
|
+
default: undefined;
|
|
172
|
+
};
|
|
173
|
+
payload: {
|
|
174
|
+
type: ObjectConstructor;
|
|
175
|
+
default: {};
|
|
176
|
+
};
|
|
177
|
+
}>;
|
|
178
|
+
_methods: unknown;
|
|
179
|
+
})[];
|
|
180
|
+
default: never[];
|
|
181
|
+
};
|
|
182
|
+
personnel: {
|
|
183
|
+
type: (import("mongoose").Schema<any> & {
|
|
184
|
+
_interface: import("../helpers").MongooseInterface<{
|
|
185
|
+
message: {
|
|
186
|
+
type: StringConstructor;
|
|
187
|
+
default: string;
|
|
188
|
+
};
|
|
189
|
+
firstSeenAt: {
|
|
190
|
+
type: DateConstructor;
|
|
191
|
+
default: typeof currentDate;
|
|
192
|
+
};
|
|
193
|
+
lastSeenAt: {
|
|
194
|
+
type: DateConstructor;
|
|
195
|
+
default: typeof currentDate;
|
|
196
|
+
};
|
|
197
|
+
clearedAt: {
|
|
198
|
+
type: DateConstructor;
|
|
199
|
+
default: undefined;
|
|
200
|
+
};
|
|
201
|
+
payload: {
|
|
202
|
+
type: ObjectConstructor;
|
|
203
|
+
default: {};
|
|
204
|
+
};
|
|
205
|
+
}>;
|
|
206
|
+
_methods: unknown;
|
|
207
|
+
})[];
|
|
208
|
+
default: never[];
|
|
209
|
+
};
|
|
210
|
+
modified: {
|
|
211
|
+
type: DateConstructor;
|
|
212
|
+
default: typeof currentDate;
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
_methods: unknown;
|
|
216
|
+
};
|
|
217
|
+
export declare function ValidationReportModule(mongoose: MongooseModule): Promise<import("mongoose").Model<import("mongoose").Document & Record<string, unknown> & {
|
|
218
|
+
_id: import("bson").ObjectID;
|
|
219
|
+
departmentId: import("bson").ObjectID;
|
|
220
|
+
location: import("../helpers").MongooseInterface<{
|
|
221
|
+
message: {
|
|
222
|
+
type: StringConstructor;
|
|
223
|
+
default: string;
|
|
224
|
+
};
|
|
225
|
+
firstSeenAt: {
|
|
226
|
+
type: DateConstructor;
|
|
227
|
+
default: typeof currentDate;
|
|
228
|
+
};
|
|
229
|
+
lastSeenAt: {
|
|
230
|
+
type: DateConstructor;
|
|
231
|
+
default: typeof currentDate;
|
|
232
|
+
};
|
|
233
|
+
clearedAt: {
|
|
234
|
+
type: DateConstructor;
|
|
235
|
+
default: undefined;
|
|
236
|
+
};
|
|
237
|
+
payload: {
|
|
238
|
+
type: ObjectConstructor;
|
|
239
|
+
default: {};
|
|
240
|
+
};
|
|
241
|
+
}>[];
|
|
242
|
+
statusMap: import("../helpers").MongooseInterface<{
|
|
243
|
+
message: {
|
|
244
|
+
type: StringConstructor;
|
|
245
|
+
default: string;
|
|
246
|
+
};
|
|
247
|
+
firstSeenAt: {
|
|
248
|
+
type: DateConstructor;
|
|
249
|
+
default: typeof currentDate;
|
|
250
|
+
};
|
|
251
|
+
lastSeenAt: {
|
|
252
|
+
type: DateConstructor;
|
|
253
|
+
default: typeof currentDate;
|
|
254
|
+
};
|
|
255
|
+
clearedAt: {
|
|
256
|
+
type: DateConstructor;
|
|
257
|
+
default: undefined;
|
|
258
|
+
};
|
|
259
|
+
payload: {
|
|
260
|
+
type: ObjectConstructor;
|
|
261
|
+
default: {};
|
|
262
|
+
};
|
|
263
|
+
}>[];
|
|
264
|
+
status: import("../helpers").MongooseInterface<{
|
|
265
|
+
message: {
|
|
266
|
+
type: StringConstructor;
|
|
267
|
+
default: string;
|
|
268
|
+
};
|
|
269
|
+
firstSeenAt: {
|
|
270
|
+
type: DateConstructor;
|
|
271
|
+
default: typeof currentDate;
|
|
272
|
+
};
|
|
273
|
+
lastSeenAt: {
|
|
274
|
+
type: DateConstructor;
|
|
275
|
+
default: typeof currentDate;
|
|
276
|
+
};
|
|
277
|
+
clearedAt: {
|
|
278
|
+
type: DateConstructor;
|
|
279
|
+
default: undefined;
|
|
280
|
+
};
|
|
281
|
+
payload: {
|
|
282
|
+
type: ObjectConstructor;
|
|
283
|
+
default: {};
|
|
284
|
+
};
|
|
285
|
+
}>[];
|
|
286
|
+
vehicleStatus: import("../helpers").MongooseInterface<{
|
|
287
|
+
message: {
|
|
288
|
+
type: StringConstructor;
|
|
289
|
+
default: string;
|
|
290
|
+
};
|
|
291
|
+
firstSeenAt: {
|
|
292
|
+
type: DateConstructor;
|
|
293
|
+
default: typeof currentDate;
|
|
294
|
+
};
|
|
295
|
+
lastSeenAt: {
|
|
296
|
+
type: DateConstructor;
|
|
297
|
+
default: typeof currentDate;
|
|
298
|
+
};
|
|
299
|
+
clearedAt: {
|
|
300
|
+
type: DateConstructor;
|
|
301
|
+
default: undefined;
|
|
302
|
+
};
|
|
303
|
+
payload: {
|
|
304
|
+
type: ObjectConstructor;
|
|
305
|
+
default: {};
|
|
306
|
+
};
|
|
307
|
+
}>[];
|
|
308
|
+
vehicle: import("../helpers").MongooseInterface<{
|
|
309
|
+
message: {
|
|
310
|
+
type: StringConstructor;
|
|
311
|
+
default: string;
|
|
312
|
+
};
|
|
313
|
+
firstSeenAt: {
|
|
314
|
+
type: DateConstructor;
|
|
315
|
+
default: typeof currentDate;
|
|
316
|
+
};
|
|
317
|
+
lastSeenAt: {
|
|
318
|
+
type: DateConstructor;
|
|
319
|
+
default: typeof currentDate;
|
|
320
|
+
};
|
|
321
|
+
clearedAt: {
|
|
322
|
+
type: DateConstructor;
|
|
323
|
+
default: undefined;
|
|
324
|
+
};
|
|
325
|
+
payload: {
|
|
326
|
+
type: ObjectConstructor;
|
|
327
|
+
default: {};
|
|
328
|
+
};
|
|
329
|
+
}>[];
|
|
330
|
+
incident: import("../helpers").MongooseInterface<{
|
|
331
|
+
message: {
|
|
332
|
+
type: StringConstructor;
|
|
333
|
+
default: string;
|
|
334
|
+
};
|
|
335
|
+
firstSeenAt: {
|
|
336
|
+
type: DateConstructor;
|
|
337
|
+
default: typeof currentDate;
|
|
338
|
+
};
|
|
339
|
+
lastSeenAt: {
|
|
340
|
+
type: DateConstructor;
|
|
341
|
+
default: typeof currentDate;
|
|
342
|
+
};
|
|
343
|
+
clearedAt: {
|
|
344
|
+
type: DateConstructor;
|
|
345
|
+
default: undefined;
|
|
346
|
+
};
|
|
347
|
+
payload: {
|
|
348
|
+
type: ObjectConstructor;
|
|
349
|
+
default: {};
|
|
350
|
+
};
|
|
351
|
+
}>[];
|
|
352
|
+
personnel: import("../helpers").MongooseInterface<{
|
|
353
|
+
message: {
|
|
354
|
+
type: StringConstructor;
|
|
355
|
+
default: string;
|
|
356
|
+
};
|
|
357
|
+
firstSeenAt: {
|
|
358
|
+
type: DateConstructor;
|
|
359
|
+
default: typeof currentDate;
|
|
360
|
+
};
|
|
361
|
+
lastSeenAt: {
|
|
362
|
+
type: DateConstructor;
|
|
363
|
+
default: typeof currentDate;
|
|
364
|
+
};
|
|
365
|
+
clearedAt: {
|
|
366
|
+
type: DateConstructor;
|
|
367
|
+
default: undefined;
|
|
368
|
+
};
|
|
369
|
+
payload: {
|
|
370
|
+
type: ObjectConstructor;
|
|
371
|
+
default: {};
|
|
372
|
+
};
|
|
373
|
+
}>[];
|
|
374
|
+
modified: string;
|
|
375
|
+
}, {}> & {
|
|
376
|
+
__methods?: unknown;
|
|
377
|
+
}>;
|
|
378
|
+
export interface ValidationReport extends ItemTypeFromTypeSchemaFunction<typeof ValidationReportModule> {
|
|
379
|
+
}
|
|
380
|
+
export interface ValidationReportModel extends ModelTypeFromTypeSchemaFunction<ValidationReport> {
|
|
381
|
+
}
|
|
382
|
+
declare const _default: ReplaceModelReturnType<typeof ValidationReportModule, ValidationReportModel>;
|
|
383
|
+
export default _default;
|
|
384
|
+
//# sourceMappingURL=validation-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-report.d.ts","sourceRoot":"","sources":["../../src/models/validation-report.ts"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EACX,8BAA8B,EAC9B,+BAA+B,EAC/B,cAAc,EACd,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAGpB,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoD9D;AAED,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGpE;AAED,MAAM,WAAW,gBAAiB,SAAQ,8BAA8B,CAAC,OAAO,sBAAsB,CAAC;CAAI;AAC3G,MAAM,WAAW,qBAAsB,SAAQ,+BAA+B,CAAC,gBAAgB,CAAC;CAAI;;AACpG,wBAAsH"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ async function wireModels(mongoose: MongooseModule) {
|
|
|
49
49
|
User: await getModel(import("./models/user")),
|
|
50
50
|
UserDevice: await getModel(import("./models/user-device")),
|
|
51
51
|
UserRegistration: await getModel(import("./models/user-registration")),
|
|
52
|
+
ValidationReport: await getModel(import("./models/validation-report")),
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -93,6 +94,7 @@ export { Template, TemplateModel } from "./models/template";
|
|
|
93
94
|
export { User, UserModel } from "./models/user";
|
|
94
95
|
export { UserDevice, UserDeviceModel } from "./models/user-device";
|
|
95
96
|
export { UserRegistration, UserRegistrationModel } from "./models/user-registration";
|
|
97
|
+
export { ValidationReport, ValidationReportModel } from "./models/validation-report";
|
|
96
98
|
|
|
97
99
|
export * from "./helpers";
|
|
98
100
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MongooseModule,
|
|
3
|
+
createSchema,
|
|
4
|
+
currentDate,
|
|
5
|
+
} from "../../helpers";
|
|
6
|
+
|
|
7
|
+
export default function ValidationErrorItemSchema(mongoose: MongooseModule) {
|
|
8
|
+
const { Schema } = mongoose;
|
|
9
|
+
|
|
10
|
+
const Item = createSchema(Schema, {
|
|
11
|
+
message: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "",
|
|
14
|
+
},
|
|
15
|
+
firstSeenAt: {
|
|
16
|
+
type: Date,
|
|
17
|
+
default: currentDate,
|
|
18
|
+
},
|
|
19
|
+
lastSeenAt: {
|
|
20
|
+
type: Date,
|
|
21
|
+
default: currentDate,
|
|
22
|
+
},
|
|
23
|
+
clearedAt: {
|
|
24
|
+
type: Date,
|
|
25
|
+
default: undefined,
|
|
26
|
+
},
|
|
27
|
+
// Req Body
|
|
28
|
+
payload: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default: {}
|
|
31
|
+
},
|
|
32
|
+
}, {
|
|
33
|
+
_id: false,
|
|
34
|
+
id: false,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return Item;
|
|
38
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createModel,
|
|
3
|
+
createSchema,
|
|
4
|
+
currentDate,
|
|
5
|
+
ItemTypeFromTypeSchemaFunction,
|
|
6
|
+
ModelTypeFromTypeSchemaFunction,
|
|
7
|
+
MongooseModule,
|
|
8
|
+
ReplaceModelReturnType,
|
|
9
|
+
} from "../helpers";
|
|
10
|
+
import ValidationErrorItemModule from "./schema/validation-error-item";
|
|
11
|
+
|
|
12
|
+
export function ValidationReportSchema(mongoose: MongooseModule) {
|
|
13
|
+
const { Schema, Types } = mongoose;
|
|
14
|
+
const ValidationErrorItem = ValidationErrorItemModule(mongoose);
|
|
15
|
+
|
|
16
|
+
const modelSchema = createSchema(Schema, {
|
|
17
|
+
_id: {
|
|
18
|
+
type: Types.ObjectId,
|
|
19
|
+
auto: true,
|
|
20
|
+
},
|
|
21
|
+
departmentId: {
|
|
22
|
+
type: Types.ObjectId,
|
|
23
|
+
ref: "Department",
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
location: {
|
|
27
|
+
type: [ValidationErrorItem],
|
|
28
|
+
default: [],
|
|
29
|
+
},
|
|
30
|
+
statusMap: {
|
|
31
|
+
type: [ValidationErrorItem],
|
|
32
|
+
default: [],
|
|
33
|
+
},
|
|
34
|
+
status: {
|
|
35
|
+
type: [ValidationErrorItem],
|
|
36
|
+
default: [],
|
|
37
|
+
},
|
|
38
|
+
vehicleStatus: {
|
|
39
|
+
type: [ValidationErrorItem],
|
|
40
|
+
default: [],
|
|
41
|
+
},
|
|
42
|
+
vehicle: {
|
|
43
|
+
type: [ValidationErrorItem],
|
|
44
|
+
default: [],
|
|
45
|
+
},
|
|
46
|
+
incident: {
|
|
47
|
+
type: [ValidationErrorItem],
|
|
48
|
+
default: [],
|
|
49
|
+
},
|
|
50
|
+
personnel: {
|
|
51
|
+
type: [ValidationErrorItem],
|
|
52
|
+
default: [],
|
|
53
|
+
},
|
|
54
|
+
modified: {
|
|
55
|
+
type: Date,
|
|
56
|
+
default: currentDate,
|
|
57
|
+
},
|
|
58
|
+
}, {
|
|
59
|
+
collection: "massive_validation_report",
|
|
60
|
+
});
|
|
61
|
+
modelSchema.set("autoIndex", false);
|
|
62
|
+
|
|
63
|
+
return modelSchema;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function ValidationReportModule(mongoose: MongooseModule) {
|
|
67
|
+
const modelSchema = ValidationReportSchema(mongoose);
|
|
68
|
+
return createModel(mongoose, "ValidationReport", modelSchema);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ValidationReport extends ItemTypeFromTypeSchemaFunction<typeof ValidationReportModule> { }
|
|
72
|
+
export interface ValidationReportModel extends ModelTypeFromTypeSchemaFunction<ValidationReport> { }
|
|
73
|
+
export default ValidationReportModule as ReplaceModelReturnType<typeof ValidationReportModule, ValidationReportModel>;
|
package/test/0index.js
CHANGED
|
@@ -15,6 +15,7 @@ describe(" Models", function() {
|
|
|
15
15
|
afterEach(function() {
|
|
16
16
|
mongoose.disconnect();
|
|
17
17
|
});
|
|
18
|
+
|
|
18
19
|
it("are wired", function() {
|
|
19
20
|
// These should match index.js
|
|
20
21
|
assert.isFunction(models.ActionLog, "Missing ActionLog");
|
|
@@ -56,5 +57,6 @@ describe(" Models", function() {
|
|
|
56
57
|
assert.isFunction(models.User, "Missing User");
|
|
57
58
|
assert.isFunction(models.UserDevice, "Missing UserDevice");
|
|
58
59
|
assert.isFunction(models.UserRegistration, "Missing UserRegistration");
|
|
60
|
+
assert.isFunction(models.ValidationReport, "Missing ValidationReport");
|
|
59
61
|
});
|
|
60
62
|
});
|
package/test/department.js
CHANGED
|
@@ -28,7 +28,7 @@ describe("Department", function() {
|
|
|
28
28
|
assert.isNotNull(sut._id);
|
|
29
29
|
assert.isNotNull(sut.id);
|
|
30
30
|
assert.equal(sut.department, testItem.department);
|
|
31
|
-
assert.equal(sut.city, testItem.city);
|
|
31
|
+
assert.equal(sut.addressDetails.city, testItem.addressDetails.city);
|
|
32
32
|
assert.isTrue(sut.active);
|
|
33
33
|
assert.equal(sut.apikey, testItem.apikey);
|
|
34
34
|
assert.equal(sut.partialApiKey, testItem.partialApiKey);
|
package/test/mock.js
CHANGED
|
@@ -191,24 +191,24 @@ module.exports = function(dependencies) {
|
|
|
191
191
|
|
|
192
192
|
const message = {
|
|
193
193
|
departmentId: "d1234",
|
|
194
|
-
"active"
|
|
195
|
-
"title"
|
|
196
|
-
"body"
|
|
197
|
-
"actionTitle"
|
|
198
|
-
"color"
|
|
199
|
-
"url"
|
|
200
|
-
"priority"
|
|
201
|
-
"type"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
194
|
+
"active": false,
|
|
195
|
+
"title": "Upgrade App",
|
|
196
|
+
"body": "Application out of date.",
|
|
197
|
+
"actionTitle": "Upgrade App",
|
|
198
|
+
"color": null,
|
|
199
|
+
"url": "",
|
|
200
|
+
"priority": 4,
|
|
201
|
+
"type": {
|
|
202
|
+
"type": "upgradeApp",
|
|
203
|
+
"typeOpts": {
|
|
204
|
+
"major": 3,
|
|
205
|
+
"minor": 0,
|
|
206
|
+
"patch": 1
|
|
207
|
+
}
|
|
208
208
|
},
|
|
209
|
-
"created"
|
|
210
|
-
"uuid"
|
|
211
|
-
"requestId"
|
|
209
|
+
"created": new Date().toISOString(),
|
|
210
|
+
"uuid": "138acffd-a94f-402d-87b3-ff6ed31a19dc",
|
|
211
|
+
"requestId": "138acffd-a94f-402d-87b3-ff6ed31a19db",
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
const cadIncident = {
|
|
@@ -380,7 +380,9 @@ module.exports = function(dependencies) {
|
|
|
380
380
|
const department = {
|
|
381
381
|
_id: mongoose.Types.ObjectId(),
|
|
382
382
|
department: "Test Department",
|
|
383
|
-
|
|
383
|
+
addressDetails: {
|
|
384
|
+
city: "San Francisco",
|
|
385
|
+
},
|
|
384
386
|
active: true,
|
|
385
387
|
apikey: "abcd",
|
|
386
388
|
partialApiKey: "ab",
|
|
@@ -779,7 +781,7 @@ module.exports = function(dependencies) {
|
|
|
779
781
|
offDutyEnabled: true,
|
|
780
782
|
webMapSettings: {
|
|
781
783
|
defaultZoomLevel: 10,
|
|
782
|
-
defaultCenter: [1,1],
|
|
784
|
+
defaultCenter: [1, 1],
|
|
783
785
|
defaultMap: "Default"
|
|
784
786
|
},
|
|
785
787
|
restrictedCommentsEnabled: true
|
|
@@ -890,6 +892,30 @@ module.exports = function(dependencies) {
|
|
|
890
892
|
sendNotification: false
|
|
891
893
|
};
|
|
892
894
|
|
|
895
|
+
const validationReport = {
|
|
896
|
+
_id: mongoose.Types.ObjectId(),
|
|
897
|
+
departmentId: new mongoose.Types.ObjectId("56131f724143487a10000001"),
|
|
898
|
+
modified: new Date("2022-11-13T22:02:01Z"),
|
|
899
|
+
location: [],
|
|
900
|
+
statusMap: [],
|
|
901
|
+
status: [],
|
|
902
|
+
vehicleStatus: [],
|
|
903
|
+
vehicle: [],
|
|
904
|
+
incident: [
|
|
905
|
+
{
|
|
906
|
+
message: "path: /ReportNumber msg: must be array",
|
|
907
|
+
firstSeenAt: new Date("2022-11-14T09:23:48.866Z"),
|
|
908
|
+
lastSeenAt: new Date("2022-11-14T09:23:48.866Z"),
|
|
909
|
+
payload: {
|
|
910
|
+
AgencyID: "99999",
|
|
911
|
+
IncidentNumber: "ABCD-1234",
|
|
912
|
+
ReportNumber: ""
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
],
|
|
916
|
+
personnel: [],
|
|
917
|
+
};
|
|
918
|
+
|
|
893
919
|
async function cleanup() {
|
|
894
920
|
config.checkIfTestDatabase();
|
|
895
921
|
|
|
@@ -897,16 +923,16 @@ module.exports = function(dependencies) {
|
|
|
897
923
|
await models.Esri.deleteMany({});
|
|
898
924
|
await models.IncidentNotified.deleteMany({});
|
|
899
925
|
await models.PersonnelImport.deleteMany({});
|
|
900
|
-
await models.UserDevice.deleteMany({});
|
|
901
926
|
await models.User.deleteMany({});
|
|
927
|
+
await models.UserDevice.deleteMany({});
|
|
928
|
+
await models.ValidationReport.deleteMany({});
|
|
902
929
|
}
|
|
903
930
|
|
|
904
931
|
return {
|
|
905
932
|
actionLog,
|
|
906
|
-
jobLog,
|
|
907
933
|
agency,
|
|
908
|
-
assignment,
|
|
909
934
|
arcGISGroup,
|
|
935
|
+
assignment,
|
|
910
936
|
battalion,
|
|
911
937
|
cadIncident,
|
|
912
938
|
cadStatus,
|
|
@@ -917,6 +943,7 @@ module.exports = function(dependencies) {
|
|
|
917
943
|
checklist,
|
|
918
944
|
checklistItem,
|
|
919
945
|
cleanup,
|
|
946
|
+
csvImport,
|
|
920
947
|
department,
|
|
921
948
|
deviceMapping,
|
|
922
949
|
esri,
|
|
@@ -924,10 +951,11 @@ module.exports = function(dependencies) {
|
|
|
924
951
|
incidentEvent,
|
|
925
952
|
incidentNotified,
|
|
926
953
|
incidentTakeover,
|
|
954
|
+
jobLog,
|
|
927
955
|
location,
|
|
928
956
|
mailLog,
|
|
929
|
-
message,
|
|
930
957
|
managedIncident,
|
|
958
|
+
message,
|
|
931
959
|
monitor,
|
|
932
960
|
personnelImport,
|
|
933
961
|
rateLimit,
|
|
@@ -936,6 +964,6 @@ module.exports = function(dependencies) {
|
|
|
936
964
|
user,
|
|
937
965
|
userDevice,
|
|
938
966
|
userRegistration,
|
|
939
|
-
|
|
967
|
+
validationReport,
|
|
940
968
|
};
|
|
941
969
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const assert = require("chai").assert;
|
|
4
|
+
|
|
5
|
+
const m = require("..");
|
|
6
|
+
const config = require("./config");
|
|
7
|
+
|
|
8
|
+
describe("ValidationReport", function() {
|
|
9
|
+
let models, mongoose;
|
|
10
|
+
let testItem;
|
|
11
|
+
beforeEach(async function() {
|
|
12
|
+
const c = await m.connect(config.url);
|
|
13
|
+
models = c.models;
|
|
14
|
+
mongoose = c.mongoose;
|
|
15
|
+
|
|
16
|
+
const mock = require("./mock")({
|
|
17
|
+
mongoose
|
|
18
|
+
});
|
|
19
|
+
testItem = mock.validationReport;
|
|
20
|
+
});
|
|
21
|
+
afterEach(function() {
|
|
22
|
+
mongoose.disconnect();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("is saved", async function() {
|
|
26
|
+
const item = new models.ValidationReport(testItem);
|
|
27
|
+
const sut = await item.save();
|
|
28
|
+
|
|
29
|
+
assert.isNotNull(item._id);
|
|
30
|
+
assert.equal(testItem.departmentId.toString(), sut.departmentId.toString());
|
|
31
|
+
assert.equal(testItem.modified.toString(), sut.modified.toString());
|
|
32
|
+
assert.deepEqual(testItem.location, []);
|
|
33
|
+
});
|
|
34
|
+
});
|