@ironcode/vas-lib 3.0.0-alpha.1 → 3.0.0-alpha.10
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/cjs/lib/control-value/vas-camera-control-value.model.d.ts +4 -2
- package/cjs/lib/control-value/vas-camera-control-value.model.d.ts.map +1 -1
- package/cjs/lib/control-value/vas-camera-control-value.model.js.map +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-base.model.js.map +1 -1
- package/cjs/lib/entity/vas-field.dto.d.ts +3 -4
- package/cjs/lib/entity/vas-field.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-field.dto.js.map +1 -1
- package/cjs/lib/entity/vas-field.model.js +1 -1
- package/cjs/lib/entity/vas-field.model.js.map +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-form.model.js.map +1 -1
- package/cjs/lib/entity/vas-job-copy.d.ts +12 -12
- package/cjs/lib/entity/vas-job-copy.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job-copy.js.map +1 -1
- package/cjs/lib/entity/vas-job.dto.d.ts +12 -3
- package/cjs/lib/entity/vas-job.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.dto.js.map +1 -1
- package/cjs/lib/entity/vas-job.model.d.ts +28 -13
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +230 -96
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.d.ts +14 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.d.ts +11 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.js +84 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.d.ts +16 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.d.ts +24 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.js +121 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.dto.d.ts +37 -0
- package/cjs/lib/model/estimate-control/estimate.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.model.d.ts +55 -0
- package/cjs/lib/model/estimate-control/estimate.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.model.js +279 -0
- package/cjs/lib/model/estimate-control/estimate.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.types.d.ts +3 -0
- package/cjs/lib/model/estimate-control/estimate.types.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.types.js +3 -0
- package/cjs/lib/model/estimate-control/estimate.types.js.map +1 -0
- package/cjs/lib/model/estimate-control/index.d.ts +8 -0
- package/cjs/lib/model/estimate-control/index.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/index.js +11 -0
- package/cjs/lib/model/estimate-control/index.js.map +1 -0
- package/cjs/lib/model/index.d.ts +2 -0
- package/cjs/lib/model/index.d.ts.map +1 -1
- package/cjs/lib/model/index.js +2 -0
- package/cjs/lib/model/index.js.map +1 -1
- package/cjs/lib/model/report-invocation.d.ts +40 -0
- package/cjs/lib/model/report-invocation.d.ts.map +1 -0
- package/cjs/lib/model/report-invocation.js +3 -0
- package/cjs/lib/model/report-invocation.js.map +1 -0
- package/cjs/lib/utils/get-value-by-path.d.ts +5 -15
- package/cjs/lib/utils/get-value-by-path.d.ts.map +1 -1
- package/cjs/lib/utils/get-value-by-path.js +48 -59
- package/cjs/lib/utils/get-value-by-path.js.map +1 -1
- package/cjs/lib/utils/index.d.ts +8 -0
- package/cjs/lib/utils/index.d.ts.map +1 -0
- package/cjs/lib/utils/index.js +11 -0
- package/cjs/lib/utils/index.js.map +1 -0
- package/cjs/lib/utils/is-array-string.d.ts +3 -0
- package/cjs/lib/utils/is-array-string.d.ts.map +1 -1
- package/cjs/lib/utils/is-array-string.js +3 -0
- package/cjs/lib/utils/is-array-string.js.map +1 -1
- package/cjs/lib/utils/is-numeric.d.ts +2 -0
- package/cjs/lib/utils/is-numeric.d.ts.map +1 -0
- package/cjs/lib/utils/is-numeric.js +10 -0
- package/cjs/lib/utils/is-numeric.js.map +1 -0
- package/cjs/lib/utils/is-plain-object.d.ts +3 -0
- package/cjs/lib/utils/is-plain-object.d.ts.map +1 -1
- package/cjs/lib/utils/is-plain-object.js +3 -0
- package/cjs/lib/utils/is-plain-object.js.map +1 -1
- package/cjs/lib/utils/try-json.d.ts +2 -2
- package/cjs/lib/utils/try-json.js +2 -2
- package/cjs/lib/utils/try-json.js.map +1 -1
- package/cjs/public-api.d.ts +1 -0
- package/cjs/public-api.d.ts.map +1 -1
- package/cjs/public-api.js +1 -0
- package/cjs/public-api.js.map +1 -1
- package/fesm2022/ironcode-vas-lib.mjs +792 -149
- package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
- package/lib/control-value/vas-camera-control-value.model.d.ts +4 -2
- package/lib/entity/vas-base.model.d.ts +1 -1
- package/lib/entity/vas-field.dto.d.ts +3 -4
- package/lib/entity/vas-form.model.d.ts +1 -1
- package/lib/entity/vas-job-copy.d.ts +12 -12
- package/lib/entity/vas-job.dto.d.ts +12 -3
- package/lib/entity/vas-job.model.d.ts +28 -13
- package/lib/model/estimate-control/estimate-control-value.dto.d.ts +13 -0
- package/lib/model/estimate-control/estimate-control-value.model.d.ts +10 -0
- package/lib/model/estimate-control/estimate-item.dto.d.ts +15 -0
- package/lib/model/estimate-control/estimate-item.model.d.ts +23 -0
- package/lib/model/estimate-control/estimate.dto.d.ts +36 -0
- package/lib/model/estimate-control/estimate.model.d.ts +54 -0
- package/lib/model/estimate-control/estimate.types.d.ts +2 -0
- package/lib/model/estimate-control/index.d.ts +7 -0
- package/lib/model/index.d.ts +2 -0
- package/lib/model/report-invocation.d.ts +39 -0
- package/lib/utils/get-value-by-path.d.ts +5 -15
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/is-array-string.d.ts +4 -0
- package/lib/utils/is-numeric.d.ts +1 -0
- package/lib/utils/is-plain-object.d.ts +3 -0
- package/lib/utils/omit.d.ts +7 -0
- package/lib/utils/try-json.d.ts +2 -2
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.VasJobDocumentModel = exports.VasJobRelationalModel = exports.VasJobBaseModel = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const vas_file_dto_1 = require("./vas-file.dto");
|
|
6
6
|
const moment_1 = tslib_1.__importDefault(require("moment"));
|
|
@@ -8,21 +8,23 @@ const get_value_by_path_1 = require("../utils/get-value-by-path");
|
|
|
8
8
|
const vas_restricted_account_object_model_1 = require("./vas-restricted-account-object.model");
|
|
9
9
|
const model_1 = require("../model");
|
|
10
10
|
const control_value_1 = require("../control-value");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
const utils_1 = require("../utils");
|
|
12
|
+
const vas_field_model_1 = require("./vas-field.model");
|
|
13
|
+
const nullables = new Set([
|
|
14
|
+
'created',
|
|
15
|
+
'modified',
|
|
16
|
+
'reference',
|
|
17
|
+
'jobDate',
|
|
18
|
+
'followUpDate',
|
|
19
|
+
'followUpStatus',
|
|
20
|
+
'followUpNote',
|
|
21
|
+
]);
|
|
14
22
|
let jobStaticProps;
|
|
15
|
-
function getJobStaticProperties() {
|
|
16
|
-
if (jobStaticProps) {
|
|
17
|
-
return jobStaticProps;
|
|
18
|
-
}
|
|
19
|
-
return jobStaticProps = new Set(Object.getOwnPropertyNames(VasJobModel.empty()));
|
|
20
|
-
}
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* VasJobBaseModel
|
|
23
25
|
*/
|
|
24
|
-
class
|
|
25
|
-
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, reference, jobDate, jobStatus, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, geoLocation, files, fields, jobEmails, notes, reports, tasks, instruction) {
|
|
26
|
+
class VasJobBaseModel extends vas_restricted_account_object_model_1.VasRestrictedAccountObjectModel {
|
|
27
|
+
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, reference, jobDate, jobStatus, jobStatusLastUpdate, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, followUpDate, followUpStatus, followUpNote, geoLocation, files, fields, jobEmails, notes, reports, tasks, instruction) {
|
|
26
28
|
super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup);
|
|
27
29
|
this.id = id;
|
|
28
30
|
this.created = created;
|
|
@@ -38,6 +40,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
38
40
|
this.reference = reference;
|
|
39
41
|
this.jobDate = jobDate;
|
|
40
42
|
this.jobStatus = jobStatus;
|
|
43
|
+
this.jobStatusLastUpdate = jobStatusLastUpdate;
|
|
41
44
|
this.jobType = jobType;
|
|
42
45
|
this.assigneeId = assigneeId;
|
|
43
46
|
this.formId = formId;
|
|
@@ -45,6 +48,9 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
45
48
|
this.pendingFields = pendingFields;
|
|
46
49
|
this.childModified = childModified;
|
|
47
50
|
this.version = version;
|
|
51
|
+
this.followUpDate = followUpDate;
|
|
52
|
+
this.followUpStatus = followUpStatus;
|
|
53
|
+
this.followUpNote = followUpNote;
|
|
48
54
|
this.geoLocation = geoLocation;
|
|
49
55
|
this.files = files;
|
|
50
56
|
this.fields = fields;
|
|
@@ -67,49 +73,8 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
67
73
|
if (jobStaticProps) {
|
|
68
74
|
return jobStaticProps;
|
|
69
75
|
}
|
|
70
|
-
return jobStaticProps =
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @return {VasJobModel}
|
|
74
|
-
*/
|
|
75
|
-
static empty() {
|
|
76
|
-
return new VasJobModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', (0, moment_1.default)().utcOffset(), 0, '', 0, (0, model_1.getEmptyGeoLocation)(), [], {}, [], [], [], [], null);
|
|
77
|
-
}
|
|
78
|
-
static fromDto(dto) {
|
|
79
|
-
// we have changed the job model and stopped using the dynamic properties
|
|
80
|
-
// from form group names to hold fields. Instead, we store a simple object
|
|
81
|
-
// where the control name (minus the "fields." prefix) is the key, and the
|
|
82
|
-
// field value is the value. However, we have to cater for data that may
|
|
83
|
-
// be persisted in the old structure, or an API response where fields is an
|
|
84
|
-
// array of VasFieldDto.
|
|
85
|
-
// 1: if dto.fields is already an object, we use the existing value
|
|
86
|
-
const fields = (0, is_plain_object_1.isPlainObject)(dto.fields) ?
|
|
87
|
-
dto.fields :
|
|
88
|
-
{};
|
|
89
|
-
// 2: if dto.fields is an array, we're handling a vas-rest response, we
|
|
90
|
-
// iterate over the fields and update the fields object.
|
|
91
|
-
Array.isArray(dto.fields) && dto.fields.forEach((field) => {
|
|
92
|
-
fields[field.controlName.replace('fields.', '')] = (0, try_json_1.tryJson)(field.value);
|
|
93
|
-
});
|
|
94
|
-
// 3: if `fields` still has no keys, we're restoring a VasJobDto object that
|
|
95
|
-
// was saved in the old "form-group" style, where dynamic keys are
|
|
96
|
-
// derived from the form-group names. We'll iterate over those keys, and
|
|
97
|
-
// update the `fields` object. Once this model is serialized back to a
|
|
98
|
-
// dto, it will have the new shape.
|
|
99
|
-
if (Object.keys(fields).length === 0) {
|
|
100
|
-
Object
|
|
101
|
-
.keys(dto)
|
|
102
|
-
.filter(key => !getJobStaticProperties().has(key))
|
|
103
|
-
.forEach(groupName => {
|
|
104
|
-
Object
|
|
105
|
-
.keys(dto[groupName])
|
|
106
|
-
.forEach(controlName => {
|
|
107
|
-
const cn = controlName.replace('fields.', '');
|
|
108
|
-
fields[cn] = dto[groupName][cn];
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
return new VasJobModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || (0, moment_1.default)().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || (0, model_1.getEmptyGeoLocation)(), dto.files || [], fields, dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
76
|
+
return jobStaticProps =
|
|
77
|
+
new Set(Object.getOwnPropertyNames(VasJobDocumentModel.empty()));
|
|
113
78
|
}
|
|
114
79
|
/**
|
|
115
80
|
* Returns an object describing how many attachments were added to this job
|
|
@@ -150,39 +115,6 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
150
115
|
getValueByPath(path = []) {
|
|
151
116
|
return (0, get_value_by_path_1.getValueByPath)(Array.isArray(path) ? path : path.split('.'), this);
|
|
152
117
|
}
|
|
153
|
-
toDto() {
|
|
154
|
-
return {
|
|
155
|
-
id: this.id,
|
|
156
|
-
created: this.created,
|
|
157
|
-
createdBy: this.createdBy,
|
|
158
|
-
modified: this.modified,
|
|
159
|
-
modifiedBy: this.modifiedBy,
|
|
160
|
-
serverCreated: this.serverCreated,
|
|
161
|
-
serverModified: this.serverModified,
|
|
162
|
-
createdByName: this.createdByName,
|
|
163
|
-
modifiedByName: this.modifiedByName,
|
|
164
|
-
account: this.account,
|
|
165
|
-
accessGroup: this.accessGroup,
|
|
166
|
-
reference: this.reference,
|
|
167
|
-
jobDate: this.jobDate,
|
|
168
|
-
jobStatus: this.jobStatus,
|
|
169
|
-
jobType: this.jobType,
|
|
170
|
-
assigneeId: this.assigneeId,
|
|
171
|
-
formId: this.formId,
|
|
172
|
-
timeZoneOffset: this.timeZoneOffset,
|
|
173
|
-
pendingFields: this.pendingFields,
|
|
174
|
-
childModified: this.childModified,
|
|
175
|
-
version: this.version,
|
|
176
|
-
geoLocation: this.geoLocation,
|
|
177
|
-
files: this.files,
|
|
178
|
-
fields: this.fields,
|
|
179
|
-
jobEmails: this.jobEmails,
|
|
180
|
-
notes: this.notes,
|
|
181
|
-
reports: this.reports,
|
|
182
|
-
tasks: this.tasks,
|
|
183
|
-
instruction: this.instruction
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
118
|
/**
|
|
187
119
|
* This method will parse a syntax that allows us to build strings from the
|
|
188
120
|
* values of from the job model. For example if the job model was:
|
|
@@ -215,7 +147,6 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
215
147
|
if (!value || typeof value !== 'string') {
|
|
216
148
|
return '';
|
|
217
149
|
}
|
|
218
|
-
const fields = this.fields;
|
|
219
150
|
return value.replace(/({[^}]*})/g, (match, token) => {
|
|
220
151
|
const syntax = token.substring(1, token.length - 1);
|
|
221
152
|
let [key, filter] = syntax.split('|');
|
|
@@ -241,8 +172,8 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
241
172
|
if (objectKey === 'job') {
|
|
242
173
|
result = (this.getValueByPath(path) || '').toString();
|
|
243
174
|
}
|
|
244
|
-
else if (objectKey === 'fields'
|
|
245
|
-
result = (
|
|
175
|
+
else if (objectKey === 'fields') {
|
|
176
|
+
result = (this.getValueByPath(['fields', ...path]) || '').toString();
|
|
246
177
|
}
|
|
247
178
|
else if (objectKey.length && options.objects && options.objects[objectKey] !== undefined) {
|
|
248
179
|
result = ((0, get_value_by_path_1.getValueByPath)(path, options.objects[objectKey]) || '').toString();
|
|
@@ -278,7 +209,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
278
209
|
return Object.assign(Object.assign({}, super.toApiDto()), { reference: this.reference || '~', jobDate: this.jobDate || '~', jobType: this.jobType || '~', accessGroup: this.accessGroup || '~', jobStatus: this.jobStatus || '~', assigneeId: this.assigneeId || '~', timeZoneOffset: this.timeZoneOffset || 0, pendingFields: this.pendingFields || 0, lastForm: this.formId || '~' });
|
|
279
210
|
}
|
|
280
211
|
static toApiPatchDto(item) {
|
|
281
|
-
return (0,
|
|
212
|
+
return (0, utils_1.only)(item, [
|
|
282
213
|
'created',
|
|
283
214
|
'modified',
|
|
284
215
|
'reference',
|
|
@@ -289,9 +220,212 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
289
220
|
'assigneeId',
|
|
290
221
|
'timeZoneOffset',
|
|
291
222
|
'pendingFields',
|
|
292
|
-
'formId'
|
|
293
|
-
|
|
223
|
+
'formId',
|
|
224
|
+
'followUpDate',
|
|
225
|
+
'followUpStatus',
|
|
226
|
+
'followUpNote',
|
|
227
|
+
], (value, key) => value[key] === null && nullables.has(key) ? '~' : value[key]);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
exports.VasJobBaseModel = VasJobBaseModel;
|
|
231
|
+
class VasJobRelationalModel extends VasJobBaseModel {
|
|
232
|
+
getValueByPath(path = []) {
|
|
233
|
+
const parts = Array.isArray(path) ? path : path.split('.');
|
|
234
|
+
if (parts[0] === 'fields') {
|
|
235
|
+
return this.getFieldValueByPath(parts[1], parts.slice(2));
|
|
236
|
+
}
|
|
237
|
+
return (0, get_value_by_path_1.getValueByPath)(parts, this);
|
|
238
|
+
}
|
|
239
|
+
getFieldsMap() {
|
|
240
|
+
return this.fields.reduce((p, c) => {
|
|
241
|
+
p[c.controlName] = c.value;
|
|
242
|
+
return p;
|
|
243
|
+
}, {});
|
|
244
|
+
}
|
|
245
|
+
getFieldValueByPath(controlName, path) {
|
|
246
|
+
for (const field of this.fields) {
|
|
247
|
+
if (field.controlName === controlName) {
|
|
248
|
+
if (path.length === 0) {
|
|
249
|
+
return field.value;
|
|
250
|
+
}
|
|
251
|
+
if (field.value === null) {
|
|
252
|
+
return path.length >= 1 ? undefined : null;
|
|
253
|
+
}
|
|
254
|
+
if ((0, utils_1.isPlainObject)(field.value)) {
|
|
255
|
+
return (0, get_value_by_path_1.getValueByPath)(path, field.value);
|
|
256
|
+
}
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return undefined;
|
|
261
|
+
}
|
|
262
|
+
static fromDto(dto) {
|
|
263
|
+
if (dto.fields !== undefined && !Array.isArray(dto.fields)) {
|
|
264
|
+
throw Error('fields must be an array');
|
|
265
|
+
}
|
|
266
|
+
return new VasJobRelationalModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobStatusLastUpdate || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || (0, moment_1.default)().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.followUpDate || '', dto.followUpStatus || '', dto.followUpNote || '', dto.geoLocation || (0, model_1.getEmptyGeoLocation)(), dto.files || [], (dto.fields || []).map(f => vas_field_model_1.VasFieldModel.fromDto(f)), dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
267
|
+
}
|
|
268
|
+
static empty() {
|
|
269
|
+
return new VasJobRelationalModel('', // id
|
|
270
|
+
'', // created
|
|
271
|
+
'', // serverCreated
|
|
272
|
+
'', // createdBy
|
|
273
|
+
'', // modified
|
|
274
|
+
'', // serverModified
|
|
275
|
+
'', // modifiedBy
|
|
276
|
+
'', // createdByName
|
|
277
|
+
'', // modifiedByName
|
|
278
|
+
'', // account
|
|
279
|
+
'', // accessGroup
|
|
280
|
+
'', // reference
|
|
281
|
+
'', // jobDate
|
|
282
|
+
'', // jobStatus
|
|
283
|
+
'', // jobStatusLastUpdate
|
|
284
|
+
'', // jobType
|
|
285
|
+
'', // assigneeId
|
|
286
|
+
'', // formId
|
|
287
|
+
(0, moment_1.default)().utcOffset(), // timeZoneOffset
|
|
288
|
+
0, // pendingFields: number,
|
|
289
|
+
'', // childModified: string,
|
|
290
|
+
0, // version: number,
|
|
291
|
+
'', // followUpDate: string,
|
|
292
|
+
'', // followUpStatus: string,
|
|
293
|
+
'', // followUpNote: string,
|
|
294
|
+
(0, model_1.getEmptyGeoLocation)(), // geoLocation: GeoLocation,
|
|
295
|
+
[], // files: Array<VasFileDto>,
|
|
296
|
+
[], // fields: FType,
|
|
297
|
+
[], // jobEmails: Array<VasJobEmailDto>,
|
|
298
|
+
[], // notes: Array<VasNoteDto>,
|
|
299
|
+
[], // reports: Array<VasReportDto>,
|
|
300
|
+
[], // tasks: Array<VasTaskDto>,
|
|
301
|
+
null // instruction: VasInstructionDto | null
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
toDto() {
|
|
305
|
+
return {
|
|
306
|
+
id: this.id,
|
|
307
|
+
created: this.created,
|
|
308
|
+
createdBy: this.createdBy,
|
|
309
|
+
modified: this.modified,
|
|
310
|
+
modifiedBy: this.modifiedBy,
|
|
311
|
+
serverCreated: this.serverCreated,
|
|
312
|
+
serverModified: this.serverModified,
|
|
313
|
+
createdByName: this.createdByName,
|
|
314
|
+
modifiedByName: this.modifiedByName,
|
|
315
|
+
account: this.account,
|
|
316
|
+
accessGroup: this.accessGroup,
|
|
317
|
+
reference: this.reference,
|
|
318
|
+
jobDate: this.jobDate,
|
|
319
|
+
jobStatus: this.jobStatus,
|
|
320
|
+
jobStatusLastUpdate: this.jobStatusLastUpdate,
|
|
321
|
+
jobType: this.jobType,
|
|
322
|
+
assigneeId: this.assigneeId,
|
|
323
|
+
formId: this.formId,
|
|
324
|
+
timeZoneOffset: this.timeZoneOffset,
|
|
325
|
+
pendingFields: this.pendingFields,
|
|
326
|
+
childModified: this.childModified,
|
|
327
|
+
version: this.version,
|
|
328
|
+
followUpDate: this.followUpDate,
|
|
329
|
+
followUpStatus: this.followUpStatus,
|
|
330
|
+
followUpNote: this.followUpNote,
|
|
331
|
+
geoLocation: this.geoLocation,
|
|
332
|
+
files: this.files,
|
|
333
|
+
fields: this.fields.map(f => f.toDto()),
|
|
334
|
+
jobEmails: this.jobEmails,
|
|
335
|
+
notes: this.notes,
|
|
336
|
+
reports: this.reports,
|
|
337
|
+
tasks: this.tasks,
|
|
338
|
+
instruction: this.instruction
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
exports.VasJobRelationalModel = VasJobRelationalModel;
|
|
343
|
+
class VasJobDocumentModel extends VasJobBaseModel {
|
|
344
|
+
static fromRelationalDto(dto) {
|
|
345
|
+
return new VasJobDocumentModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobStatusLastUpdate || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || (0, moment_1.default)().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.followUpDate || '', dto.followUpStatus || '', dto.followUpNote || '', dto.geoLocation || (0, model_1.getEmptyGeoLocation)(), dto.files || [], (dto.fields || []).reduce((p, c) => {
|
|
346
|
+
p[c.controlName.replace('fields.', '')] = c.value;
|
|
347
|
+
return p;
|
|
348
|
+
}, {}), dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
349
|
+
}
|
|
350
|
+
static fromDto(dto) {
|
|
351
|
+
if (dto.fields !== undefined && !(0, utils_1.isPlainObject)(dto.fields)) {
|
|
352
|
+
throw Error('fields must be an object');
|
|
353
|
+
}
|
|
354
|
+
return new VasJobDocumentModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobStatusLastUpdate || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || (0, moment_1.default)().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.followUpDate || '', dto.followUpStatus || '', dto.followUpNote || '', dto.geoLocation || (0, model_1.getEmptyGeoLocation)(), dto.files || [], dto.fields || {}, dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
355
|
+
}
|
|
356
|
+
static empty() {
|
|
357
|
+
return new VasJobDocumentModel('', // id
|
|
358
|
+
'', // created
|
|
359
|
+
'', // serverCreated
|
|
360
|
+
'', // createdBy
|
|
361
|
+
'', // modified
|
|
362
|
+
'', // serverModified
|
|
363
|
+
'', // modifiedBy
|
|
364
|
+
'', // createdByName
|
|
365
|
+
'', // modifiedByName
|
|
366
|
+
'', // account
|
|
367
|
+
'', // accessGroup
|
|
368
|
+
'', // reference
|
|
369
|
+
'', // jobDate
|
|
370
|
+
'', // jobStatus
|
|
371
|
+
'', // jobStatusLastUpdate
|
|
372
|
+
'', // jobType
|
|
373
|
+
'', // assigneeId
|
|
374
|
+
'', // formId
|
|
375
|
+
(0, moment_1.default)().utcOffset(), // timeZoneOffset
|
|
376
|
+
0, // pendingFields: number,
|
|
377
|
+
'', // childModified: string,
|
|
378
|
+
0, // version: number,
|
|
379
|
+
'', // followUpDate: string,
|
|
380
|
+
'', // followUpStatus: string,
|
|
381
|
+
'', // followUpNote: string,
|
|
382
|
+
(0, model_1.getEmptyGeoLocation)(), // geoLocation: GeoLocation,
|
|
383
|
+
[], // files: Array<VasFileDto>,
|
|
384
|
+
{}, // fields: FType,
|
|
385
|
+
[], // jobEmails: Array<VasJobEmailDto>,
|
|
386
|
+
[], // notes: Array<VasNoteDto>,
|
|
387
|
+
[], // reports: Array<VasReportDto>,
|
|
388
|
+
[], // tasks: Array<VasTaskDto>,
|
|
389
|
+
null // instruction: VasInstructionDto | null
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
toDto() {
|
|
393
|
+
return {
|
|
394
|
+
id: this.id,
|
|
395
|
+
created: this.created,
|
|
396
|
+
createdBy: this.createdBy,
|
|
397
|
+
modified: this.modified,
|
|
398
|
+
modifiedBy: this.modifiedBy,
|
|
399
|
+
serverCreated: this.serverCreated,
|
|
400
|
+
serverModified: this.serverModified,
|
|
401
|
+
createdByName: this.createdByName,
|
|
402
|
+
modifiedByName: this.modifiedByName,
|
|
403
|
+
account: this.account,
|
|
404
|
+
accessGroup: this.accessGroup,
|
|
405
|
+
reference: this.reference,
|
|
406
|
+
jobDate: this.jobDate,
|
|
407
|
+
jobStatus: this.jobStatus,
|
|
408
|
+
jobStatusLastUpdate: this.jobStatusLastUpdate,
|
|
409
|
+
jobType: this.jobType,
|
|
410
|
+
assigneeId: this.assigneeId,
|
|
411
|
+
formId: this.formId,
|
|
412
|
+
timeZoneOffset: this.timeZoneOffset,
|
|
413
|
+
pendingFields: this.pendingFields,
|
|
414
|
+
childModified: this.childModified,
|
|
415
|
+
version: this.version,
|
|
416
|
+
followUpDate: this.followUpDate,
|
|
417
|
+
followUpStatus: this.followUpStatus,
|
|
418
|
+
followUpNote: this.followUpNote,
|
|
419
|
+
geoLocation: this.geoLocation,
|
|
420
|
+
files: this.files,
|
|
421
|
+
fields: this.fields,
|
|
422
|
+
jobEmails: this.jobEmails,
|
|
423
|
+
notes: this.notes,
|
|
424
|
+
reports: this.reports,
|
|
425
|
+
tasks: this.tasks,
|
|
426
|
+
instruction: this.instruction
|
|
427
|
+
};
|
|
294
428
|
}
|
|
295
429
|
}
|
|
296
|
-
exports.
|
|
430
|
+
exports.VasJobDocumentModel = VasJobDocumentModel;
|
|
297
431
|
//# sourceMappingURL=vas-job.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-job.model.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.model.ts"],"names":[],"mappings":";;;;AAAA,iDAAuD;AACvD,4DAA4B;AAC5B,kEAA4D;AAK5D,+FAAwF;AACxF,oCAA4D;AAC5D,oDAA8G;AAC9G,wCAAqC;AAMrC,gDAA4C;AAC5C,8DAAyD;AAgBzD,IAAI,cAAuC,CAAC;AAE5C,SAAS,sBAAsB;IAC7B,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,OAAO,cAAc,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC;AAED;;GAEG;AACH,MAAa,WAAY,SAAQ,qEAA+B;IAE9D,YACkB,EAAU,EACV,OAAe,EACf,aAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,cAAsB,EACtB,UAAkB,EAClB,aAAqB,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AO,EAAE,IAAI,CAAC,OAAO,IAAI,GAAG,EAC5B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,GAAG,EAC5B,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,GAAG,EACpC,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,GAAG,EAChC,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,GAAG,EAClC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,CAAC,EACxC,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,CAAC,EACtC,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,GAAG,IAC5B;IACJ,CAAC;IAEM,MAAM,CAAC,aAAa,CACzB,IAAwB;QAExB,OAAO,IAAA,WAAI,EACT,IAAI,EACJ;YACE,SAAS;YACT,UAAU;YACV,WAAW;YACX,SAAS;YACT,SAAS;YACT,aAAa;YACb,WAAW;YACX,YAAY;YACZ,gBAAgB;YAChB,eAAe;YACf,QAAQ;SACT,CACF,CAAC;IACJ,CAAC;CACF;AAvYD,kCAuYC","sourcesContent":["import { isFileDto, VasFileDto } from './vas-file.dto';\nimport moment from 'moment';\nimport { getValueByPath } from '../utils/get-value-by-path';\nimport { VasBaseDto } from './vas-base.dto';\nimport { FieldValueType, VasFieldDto } from './vas-field.dto';\nimport { VasFormModel } from './vas-form.model';\nimport { VasJobDto } from './vas-job.dto';\nimport { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';\nimport { GeoLocation, getEmptyGeoLocation } from '../model';\nimport { isCameraControlValueV1, VasCameraControlValueModel, isCameraControlValueV2 } from '../control-value';\nimport { only } from '../utils/only';\nimport { VasReportDto } from './vas-report.dto';\nimport { VasTaskDto } from './vas-task.dto';\nimport { VasNoteDto } from './vas-note.dto';\nimport { VasJobEmailDto } from './vas-job-email.dto';\nimport { VasInstructionDto } from './vas-instruction.dto';\nimport { tryJson } from \"../utils/try-json\";\nimport { isPlainObject } from \"../utils/is-plain-object\";\n\nexport interface ParseSyntaxOptions {\n // This value will be used to adjust any datetime values that are referenced\n // in the syntax string. See\n // https://momentjscom.readthedocs.io/en/latest/moment/03-manipulating/09-utc-offset/\n // for more information about how `moment` will handle the value.\n timeZoneOffset: number,\n // this dictionary can be passed in to contain other objects to be referenced\n // in the syntax. For example if we have {job.foo} this will reference the\n // job's `foo` property, however if we have \"reportLayout.title\" this will\n // expect to find a property of `objects` called `reportLayout` which will\n // have a property called `title`\n objects?: Record<string, Partial<VasBaseDto> | Record<string, FieldValueType>>;\n}\n\nlet jobStaticProps: Set<string> | undefined;\n\nfunction getJobStaticProperties() {\n if (jobStaticProps) {\n return jobStaticProps;\n }\n return jobStaticProps = new Set(Object.getOwnPropertyNames(VasJobModel.empty()));\n}\n\n/**\n * JobModel\n */\nexport class VasJobModel extends VasRestrictedAccountObjectModel {\n\n constructor(\n public override id: string,\n public override created: string,\n public override serverCreated: string,\n public override createdBy: string,\n public override modified: string,\n public override serverModified: string,\n public override modifiedBy: string,\n public override createdByName: string,\n public override modifiedByName: string,\n public override account: string,\n public override accessGroup: string,\n public reference: string,\n public jobDate: string,\n public jobStatus: string,\n public jobType: string,\n public assigneeId: string,\n public formId: string,\n public timeZoneOffset: number,\n public pendingFields: number,\n public childModified: string,\n public version: number,\n public geoLocation: GeoLocation,\n public files: Array<VasFileDto>,\n public fields: Record<string, FieldValueType>,\n public jobEmails: Array<VasJobEmailDto>,\n public notes: Array<VasNoteDto>,\n public reports: Array<VasReportDto>,\n public tasks: Array<VasTaskDto>,\n public instruction: VasInstructionDto | null\n ) {\n super(\n id,\n created,\n serverCreated,\n createdBy,\n modified,\n serverModified,\n modifiedBy,\n createdByName,\n modifiedByName,\n account,\n accessGroup\n );\n }\n\n get createdByDisplayName(): string {\n return this.createdByName;\n }\n\n get modifiedByDisplayName(): string {\n return this.modifiedByName;\n }\n\n /**\n * Return the list of Job properties\n */\n get staticProperties(): Set<string> {\n if (jobStaticProps) {\n return jobStaticProps;\n }\n return jobStaticProps = new Set(Object.getOwnPropertyNames(VasJobModel.empty()));\n }\n\n /**\n * @return {VasJobModel}\n */\n static empty(): VasJobModel {\n return new VasJobModel(\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n moment().utcOffset(),\n 0,\n '',\n 0,\n getEmptyGeoLocation(),\n [],\n {},\n [],\n [],\n [],\n [],\n null\n );\n }\n\n static override fromDto(dto: Partial<VasJobDto>): VasJobModel {\n // we have changed the job model and stopped using the dynamic properties\n // from form group names to hold fields. Instead, we store a simple object\n // where the control name (minus the \"fields.\" prefix) is the key, and the\n // field value is the value. However, we have to cater for data that may\n // be persisted in the old structure, or an API response where fields is an\n // array of VasFieldDto.\n\n // 1: if dto.fields is already an object, we use the existing value\n const fields: Record<string, FieldValueType> =\n isPlainObject<Record<string, FieldValueType>>(dto.fields) ?\n dto.fields :\n {};\n\n // 2: if dto.fields is an array, we're handling a vas-rest response, we\n // iterate over the fields and update the fields object.\n Array.isArray(dto.fields) && dto.fields.forEach((field: VasFieldDto) => {\n fields[field.controlName.replace('fields.', '')] = tryJson(field.value);\n });\n\n // 3: if `fields` still has no keys, we're restoring a VasJobDto object that\n // was saved in the old \"form-group\" style, where dynamic keys are\n // derived from the form-group names. We'll iterate over those keys, and\n // update the `fields` object. Once this model is serialized back to a\n // dto, it will have the new shape.\n if (Object.keys(fields).length === 0) {\n Object\n .keys(dto)\n .filter(key => !getJobStaticProperties().has(key))\n .forEach(groupName => {\n Object\n .keys((dto as any)[groupName])\n .forEach(controlName => {\n const cn = controlName.replace('fields.', '');\n fields[cn] = (dto as any)[groupName][cn];\n });\n });\n }\n\n return new VasJobModel(\n dto.id || '',\n dto.created || '',\n dto.serverCreated || '',\n dto.createdBy || '',\n dto.modified || '',\n dto.serverModified || '',\n dto.modifiedBy || '',\n dto.createdByName || '',\n dto.modifiedByName || '',\n dto.account || '',\n dto.accessGroup || '',\n dto.reference || '',\n dto.jobDate || '',\n dto.jobStatus || '',\n dto.jobType || '',\n dto.assigneeId || '',\n dto.formId || (dto as any).lastForm || '',\n dto.timeZoneOffset || moment().utcOffset(),\n dto.pendingFields || 0,\n dto.childModified || '',\n dto.version || 0,\n dto.geoLocation || getEmptyGeoLocation(),\n dto.files || [],\n fields,\n dto.jobEmails || [],\n dto.notes || [],\n dto.reports || [],\n dto.tasks || [],\n dto.instruction || null\n );\n }\n\n /**\n * Returns an object describing how many attachments were added to this job\n * (camera controls and files), and how many have not been uploaded yet.\n *\n * @param formModel instance of {@link VasFormModel} that was used when the\n * job was created\n */\n getFilesUploadStatus(\n formModel: VasFormModel\n ): { pending: number; total: number } {\n\n const cameraFieldValues = Object\n .values(this.fields)\n .filter(value => isCameraControlValueV2(value) || isCameraControlValueV1(value));\n\n\n let total = cameraFieldValues.length + this.files.length;\n\n // calculate the number of camera images still to upload\n let pending = cameraFieldValues\n .map((value: VasFileDto | VasCameraControlValueModel) => {\n if (isFileDto(value)) {\n return value.id && value.status !== 'COMPLETE';\n } else if (isCameraControlValueV1(value)) {\n // if url is not set, it hasn't been uploaded\n return value.id && !value.url;\n }\n return false;\n })\n .filter(hasUploaded => hasUploaded)\n .length;\n\n // add count of job.files that are complete\n pending += this.files.filter(value => value.status !== 'COMPLETE').length;\n\n return {\n pending,\n total\n };\n }\n\n /**\n * @param path path segments\n */\n getValueByPath<T>(\n path: string | string[] = []\n ): T | undefined {\n return getValueByPath<T>(\n Array.isArray(path) ? path : path.split('.'),\n this\n );\n }\n\n public toDto(): VasJobDto {\n return {\n id: this.id,\n created: this.created,\n createdBy: this.createdBy,\n modified: this.modified,\n modifiedBy: this.modifiedBy,\n serverCreated: this.serverCreated,\n serverModified: this.serverModified,\n createdByName: this.createdByName,\n modifiedByName: this.modifiedByName,\n account: this.account,\n accessGroup: this.accessGroup,\n reference: this.reference,\n jobDate: this.jobDate,\n jobStatus: this.jobStatus,\n jobType: this.jobType,\n assigneeId: this.assigneeId,\n formId: this.formId,\n timeZoneOffset: this.timeZoneOffset,\n pendingFields: this.pendingFields,\n childModified: this.childModified,\n version: this.version,\n geoLocation: this.geoLocation,\n files: this.files,\n fields: this.fields,\n jobEmails: this.jobEmails,\n notes: this.notes,\n reports: this.reports,\n tasks: this.tasks,\n instruction: this.instruction\n };\n }\n\n /**\n * This method will parse a syntax that allows us to build strings from the\n * values of from the job model. For example if the job model was:\n *\n * {\n * foo: 'bar'\n * }\n *\n * and we pass \"i am foo {foo}\", the result would be:\n *\n * \"i am foo bar\"\n *\n * we can also use moment to parse dates, for example if the job model was:\n *\n * {\n * created: \"2022-01-01T00:00:00+0000\"\n * }\n *\n * and we pass \"{created|date:YY-MM-DD}\", the result would be:\n *\n * \"2022-01-01\"\n *\n * @param {string} value a string with the syntax\n * @param {ParseSyntaxOptions} options\n * @return the results of parsing the syntax on this job\n */\n parseSyntax(\n value: string,\n options: ParseSyntaxOptions = {\n timeZoneOffset: 0\n }\n ): string {\n\n if (!value || typeof value !== 'string') {\n return '';\n }\n const fields = this.fields;\n return value.replace(/({[^}]*})/g, (match: string, token: string) => {\n const syntax = token.substring(1, token.length - 1);\n\n let [key, filter] = syntax.split('|');\n key = (key || '').trim();\n filter = (filter || '').trim();\n\n let filterName, filterArg: string = '';\n if (filter) {\n const splitIndex = filter.indexOf(':');\n if (splitIndex !== -1) {\n filterName = filter.substring(0, splitIndex);\n filterArg = filter.substring(splitIndex + 1);\n } else {\n filterName = filter;\n filterArg = '';\n }\n filterName = (filterName || '').trim();\n filterArg = (filterArg || '').trim();\n }\n const path = key.split('.');\n const objectKey = path.shift() || '';\n let result = '';\n if (objectKey === 'job') {\n result = (this.getValueByPath(path) || '').toString();\n } else if (objectKey === 'fields' || this.fields[path[0]] !== undefined) {\n result = (getValueByPath(path, fields) || '').toString();\n } else if (objectKey.length && options.objects && options.objects[objectKey] !== undefined) {\n result = (getValueByPath(path, options.objects[objectKey]) || '').toString();\n } else {\n return '';\n }\n\n if (filterName && result) {\n switch (filterName) {\n case 'date': {\n if (!options.timeZoneOffset) {\n return moment(result).format(filterArg || '');\n } else {\n return moment(result)\n .utcOffset(options.timeZoneOffset)\n .format(filterArg || '');\n }\n }\n default: {\n console.warn('unknown filter %s', filterName);\n }\n }\n }\n\n return result;\n }).trim();\n };\n\n /**\n * @return {object}\n */\n override toApiDto(): Record<string, string | number | boolean> {\n return {\n ...super.toApiDto(),\n reference: this.reference || '~',\n jobDate: this.jobDate || '~',\n jobType: this.jobType || '~',\n accessGroup: this.accessGroup || '~',\n jobStatus: this.jobStatus || '~',\n assigneeId: this.assigneeId || '~',\n timeZoneOffset: this.timeZoneOffset || 0,\n pendingFields: this.pendingFields || 0,\n lastForm: this.formId || '~'\n };\n }\n\n public static toApiPatchDto(\n item: Partial<VasJobDto>\n ): Partial<VasJobDto> {\n return only(\n item,\n [\n 'created',\n 'modified',\n 'reference',\n 'jobDate',\n 'jobType',\n 'accessGroup',\n 'jobStatus',\n 'assigneeId',\n 'timeZoneOffset',\n 'pendingFields',\n 'formId'\n ]\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vas-job.model.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.model.ts"],"names":[],"mappings":";;;;AAAA,iDAAuD;AACvD,4DAA4B;AAC5B,kEAA4D;AAK5D,+FAAwF;AACxF,oCAA4D;AAC5D,oDAA8G;AAC9G,oCAA+C;AAM/C,uDAAkD;AAElD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,SAAS;IACT,UAAU;IACV,WAAW;IACX,SAAS;IACT,cAAc;IACd,gBAAgB;IAChB,cAAc;CACf,CAAC,CAAC;AAgBH,IAAI,cAAuC,CAAC;AAG5C;;GAEG;AACH,MAAsB,eAAqF,SAAQ,qEAA+B;IAEhJ,YACkB,EAAU,EACV,OAAe,EACf,aAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,cAAsB,EACtB,UAAkB,EAClB,aAAqB,EACrB,cAAsB,EACtB,OAAe,EACf,WAAmB,EAC5B,SAAiB,EACjB,OAAe,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,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;IACJ,CAAC;CACF;AAjKD,kDAiKC","sourcesContent":["import { isFileDto, VasFileDto } from './vas-file.dto';\nimport moment from 'moment';\nimport { getValueByPath } from '../utils/get-value-by-path';\nimport { VasBaseDto } from './vas-base.dto';\nimport { FieldValueType } from './vas-field.dto';\nimport { VasFormModel } from './vas-form.model';\nimport { VasJobBaseDto, VasJobDocumentDto, VasJobRelationalDto } from './vas-job.dto';\nimport { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';\nimport { GeoLocation, getEmptyGeoLocation } from '../model';\nimport { isCameraControlValueV1, isCameraControlValueV2, VasCameraControlValueModel } from '../control-value';\nimport { isPlainObject, only } from '../utils';\nimport { VasReportDto } from './vas-report.dto';\nimport { VasTaskDto } from './vas-task.dto';\nimport { VasNoteDto } from './vas-note.dto';\nimport { VasJobEmailDto } from './vas-job-email.dto';\nimport { VasInstructionDto } from './vas-instruction.dto';\nimport { VasFieldModel } from './vas-field.model';\n\nconst nullables = new Set([\n 'created',\n 'modified',\n 'reference',\n 'jobDate',\n 'followUpDate',\n 'followUpStatus',\n 'followUpNote',\n]);\n\nexport interface ParseSyntaxOptions {\n // This value will be used to adjust any datetime values that are referenced\n // in the syntax string. See\n // https://momentjscom.readthedocs.io/en/latest/moment/03-manipulating/09-utc-offset/\n // for more information about how `moment` will handle the value.\n timeZoneOffset: number,\n // this dictionary can be passed in to contain other objects to be referenced\n // in the syntax. For example if we have {job.foo} this will reference the\n // job's `foo` property, however if we have \"reportLayout.title\" this will\n // expect to find a property of `objects` called `reportLayout` which will\n // have a property called `title`\n objects?: Record<string, Partial<VasBaseDto> | Record<string, FieldValueType>>;\n}\n\nlet jobStaticProps: Set<string> | undefined;\n\n\n/**\n * VasJobBaseModel\n */\nexport abstract class VasJobBaseModel<FType extends Record<string, FieldValueType> | Array<VasFieldModel>> extends VasRestrictedAccountObjectModel {\n\n constructor(\n public override id: string,\n public override created: string,\n public override serverCreated: string,\n public override createdBy: string,\n public override modified: string,\n public override serverModified: string,\n public override modifiedBy: string,\n public override createdByName: string,\n public override modifiedByName: string,\n public override account: string,\n public override accessGroup: string,\n public reference: string,\n public jobDate: string,\n public jobStatus: string,\n public jobStatusLastUpdate: string,\n public jobType: string,\n public assigneeId: string,\n public formId: string,\n public timeZoneOffset: number,\n public pendingFields: number,\n public childModified: string,\n public version: number,\n public followUpDate: string,\n public followUpStatus: string,\n public followUpNote: string,\n public geoLocation: GeoLocation,\n public files: Array<VasFileDto>,\n public fields: FType,\n public jobEmails: Array<VasJobEmailDto>,\n public notes: Array<VasNoteDto>,\n public reports: Array<VasReportDto>,\n public tasks: Array<VasTaskDto>,\n public instruction: VasInstructionDto | null\n ) {\n super(\n id,\n created,\n serverCreated,\n createdBy,\n modified,\n serverModified,\n modifiedBy,\n createdByName,\n modifiedByName,\n account,\n accessGroup\n );\n }\n\n get createdByDisplayName(): string {\n return this.createdByName;\n }\n\n get modifiedByDisplayName(): string {\n return this.modifiedByName;\n }\n\n /**\n * Return the list of Job properties\n */\n get staticProperties(): Set<string> {\n if (jobStaticProps) {\n return jobStaticProps;\n }\n return jobStaticProps =\n new Set(Object.getOwnPropertyNames(VasJobDocumentModel.empty()));\n }\n\n /**\n * Returns an object describing how many attachments were added to this job\n * (camera controls and files), and how many have not been uploaded yet.\n *\n * @param formModel instance of {@link VasFormModel} that was used when the\n * job was created\n */\n getFilesUploadStatus(\n formModel: VasFormModel\n ): { pending: number; total: number } {\n\n const cameraFieldValues = Object\n .values(this.fields)\n .filter(value => isCameraControlValueV2(value) || isCameraControlValueV1(value));\n\n\n let total = cameraFieldValues.length + this.files.length;\n\n // calculate the number of camera images still to upload\n let pending = cameraFieldValues\n .map((value: VasFileDto | VasCameraControlValueModel) => {\n if (isFileDto(value)) {\n return value.id && value.status !== 'COMPLETE';\n } else if (isCameraControlValueV1(value)) {\n // if url is not set, it hasn't been uploaded\n return value.id && !value.url;\n }\n return false;\n })\n .filter(hasUploaded => hasUploaded)\n .length;\n\n // add count of job.files that are complete\n pending += this.files.filter(value => value.status !== 'COMPLETE').length;\n\n return {\n pending,\n total\n };\n }\n\n /**\n * @param path path segments\n */\n getValueByPath<T>(\n path: string | string[] = []\n ): T | null | undefined {\n return getValueByPath<T>(\n Array.isArray(path) ? path : path.split('.'),\n this\n );\n }\n\n /**\n * This method will parse a syntax that allows us to build strings from the\n * values of from the job model. For example if the job model was:\n *\n * {\n * foo: 'bar'\n * }\n *\n * and we pass \"i am foo {foo}\", the result would be:\n *\n * \"i am foo bar\"\n *\n * we can also use moment to parse dates, for example if the job model was:\n *\n * {\n * created: \"2022-01-01T00:00:00+0000\"\n * }\n *\n * and we pass \"{created|date:YY-MM-DD}\", the result would be:\n *\n * \"2022-01-01\"\n *\n * @param {string} value a string with the syntax\n * @param {ParseSyntaxOptions} options\n * @return the results of parsing the syntax on this job\n */\n parseSyntax(\n value: string,\n options: ParseSyntaxOptions = {\n timeZoneOffset: 0\n }\n ): string {\n\n if (!value || typeof value !== 'string') {\n return '';\n }\n return value.replace(/({[^}]*})/g, (match: string, token: string) => {\n const syntax = token.substring(1, token.length - 1);\n\n let [key, filter] = syntax.split('|');\n key = (key || '').trim();\n filter = (filter || '').trim();\n\n let filterName, filterArg: string = '';\n if (filter) {\n const splitIndex = filter.indexOf(':');\n if (splitIndex !== -1) {\n filterName = filter.substring(0, splitIndex);\n filterArg = filter.substring(splitIndex + 1);\n } else {\n filterName = filter;\n filterArg = '';\n }\n filterName = (filterName || '').trim();\n filterArg = (filterArg || '').trim();\n }\n const path = key.split('.');\n const objectKey = path.shift() || '';\n let result = '';\n if (objectKey === 'job') {\n result = (this.getValueByPath(path) || '').toString();\n } else if (objectKey === 'fields') {\n result = (this.getValueByPath(['fields', ...path]) || '').toString();\n } else if (objectKey.length && options.objects && options.objects[objectKey] !== undefined) {\n result = (getValueByPath(path, options.objects[objectKey]) || '').toString();\n } else {\n return '';\n }\n\n if (filterName && result) {\n switch (filterName) {\n case 'date': {\n if (!options.timeZoneOffset) {\n return moment(result).format(filterArg || '');\n } else {\n return moment(result)\n .utcOffset(options.timeZoneOffset)\n .format(filterArg || '');\n }\n }\n default: {\n console.warn('unknown filter %s', filterName);\n }\n }\n }\n\n return result;\n }).trim();\n };\n\n /**\n * @return {object}\n */\n override toApiDto(): Record<string, string | number | boolean> {\n return {\n ...super.toApiDto(),\n reference: this.reference || '~',\n jobDate: this.jobDate || '~',\n jobType: this.jobType || '~',\n accessGroup: this.accessGroup || '~',\n jobStatus: this.jobStatus || '~',\n assigneeId: this.assigneeId || '~',\n timeZoneOffset: this.timeZoneOffset || 0,\n pendingFields: this.pendingFields || 0,\n lastForm: this.formId || '~'\n };\n }\n\n public static toApiPatchDto(\n item: Partial<VasJobBaseDto>\n ): Partial<VasJobBaseDto> {\n return only(\n item,\n [\n 'created',\n 'modified',\n 'reference',\n 'jobDate',\n 'jobType',\n 'accessGroup',\n 'jobStatus',\n 'assigneeId',\n 'timeZoneOffset',\n 'pendingFields',\n 'formId',\n 'followUpDate',\n 'followUpStatus',\n 'followUpNote',\n ],\n (value: any, key: keyof VasJobRelationalDto) =>\n value[key] === null && nullables.has(key) ? '~' : value[key]\n );\n }\n}\n\nexport class VasJobRelationalModel extends VasJobBaseModel<Array<VasFieldModel>> {\n\n override getValueByPath<T>(\n path: string | string[] = []\n ): T | null | undefined {\n const parts = Array.isArray(path) ? path : path.split('.');\n if (parts[0] === 'fields') {\n return this.getFieldValueByPath(parts[1], parts.slice(2)) as T;\n }\n return getValueByPath<T>(parts, this);\n }\n\n getFieldsMap(): Record<string, FieldValueType> {\n return this.fields.reduce((p, c) => {\n p[c.controlName] = c.value;\n return p;\n }, {} as Record<string, FieldValueType>);\n }\n\n getFieldValueByPath<T extends FieldValueType>(\n controlName: string,\n path: string[]\n ): T | null | undefined {\n for (const field of this.fields) {\n if (field.controlName === controlName) {\n if (path.length === 0) {\n return field.value as T;\n }\n if (field.value === null) {\n return path.length >= 1 ? undefined : null;\n }\n if (isPlainObject<object>(field.value)) {\n return getValueByPath(path, field.value);\n }\n return undefined;\n }\n }\n return undefined;\n }\n\n static override fromDto(dto: Partial<VasJobRelationalDto>): VasJobRelationalModel {\n\n if (dto.fields !== undefined && !Array.isArray(dto.fields)) {\n throw Error('fields must be an array');\n }\n\n return new VasJobRelationalModel(\n dto.id || '',\n dto.created || '',\n dto.serverCreated || '',\n dto.createdBy || '',\n dto.modified || '',\n dto.serverModified || '',\n dto.modifiedBy || '',\n dto.createdByName || '',\n dto.modifiedByName || '',\n dto.account || '',\n dto.accessGroup || '',\n dto.reference || '',\n dto.jobDate || '',\n dto.jobStatus || '',\n dto.jobStatusLastUpdate || '',\n dto.jobType || '',\n dto.assigneeId || '',\n dto.formId || (dto as any).lastForm || '',\n dto.timeZoneOffset || moment().utcOffset(),\n dto.pendingFields || 0,\n dto.childModified || '',\n dto.version || 0,\n dto.followUpDate || '',\n dto.followUpStatus || '',\n dto.followUpNote || '',\n dto.geoLocation || getEmptyGeoLocation(),\n dto.files || [],\n (dto.fields || []).map(f => VasFieldModel.fromDto(f)),\n dto.jobEmails || [],\n dto.notes || [],\n dto.reports || [],\n dto.tasks || [],\n dto.instruction || null\n );\n }\n\n static empty(): VasJobRelationalModel {\n return new VasJobRelationalModel(\n '', // id\n '', // created\n '', // serverCreated\n '', // createdBy\n '', // modified\n '', // serverModified\n '', // modifiedBy\n '', // createdByName\n '', // modifiedByName\n '', // account\n '', // accessGroup\n '', // reference\n '', // jobDate\n '', // jobStatus\n '', // jobStatusLastUpdate\n '', // jobType\n '', // assigneeId\n '', // formId\n moment().utcOffset(), // timeZoneOffset\n 0, // pendingFields: number,\n '', // childModified: string,\n 0, // version: number,\n '', // followUpDate: string,\n '', // followUpStatus: string,\n '', // followUpNote: string,\n getEmptyGeoLocation(), // geoLocation: GeoLocation,\n [], // files: Array<VasFileDto>,\n [], // fields: FType,\n [], // jobEmails: Array<VasJobEmailDto>,\n [], // notes: Array<VasNoteDto>,\n [], // reports: Array<VasReportDto>,\n [], // tasks: Array<VasTaskDto>,\n null // instruction: VasInstructionDto | null\n );\n }\n\n public toDto(): VasJobRelationalDto {\n return {\n id: this.id,\n created: this.created,\n createdBy: this.createdBy,\n modified: this.modified,\n modifiedBy: this.modifiedBy,\n serverCreated: this.serverCreated,\n serverModified: this.serverModified,\n createdByName: this.createdByName,\n modifiedByName: this.modifiedByName,\n account: this.account,\n accessGroup: this.accessGroup,\n reference: this.reference,\n jobDate: this.jobDate,\n jobStatus: this.jobStatus,\n jobStatusLastUpdate: this.jobStatusLastUpdate,\n jobType: this.jobType,\n assigneeId: this.assigneeId,\n formId: this.formId,\n timeZoneOffset: this.timeZoneOffset,\n pendingFields: this.pendingFields,\n childModified: this.childModified,\n version: this.version,\n followUpDate: this.followUpDate,\n followUpStatus: this.followUpStatus,\n followUpNote: this.followUpNote,\n geoLocation: this.geoLocation,\n files: this.files,\n fields: this.fields.map(f => f.toDto()),\n jobEmails: this.jobEmails,\n notes: this.notes,\n reports: this.reports,\n tasks: this.tasks,\n instruction: this.instruction\n };\n }\n}\n\nexport class VasJobDocumentModel extends VasJobBaseModel<Record<string, FieldValueType>> {\n\n static fromRelationalDto(dto: Partial<VasJobRelationalDto>): VasJobDocumentModel {\n return new VasJobDocumentModel(\n dto.id || '',\n dto.created || '',\n dto.serverCreated || '',\n dto.createdBy || '',\n dto.modified || '',\n dto.serverModified || '',\n dto.modifiedBy || '',\n dto.createdByName || '',\n dto.modifiedByName || '',\n dto.account || '',\n dto.accessGroup || '',\n dto.reference || '',\n dto.jobDate || '',\n dto.jobStatus || '',\n dto.jobStatusLastUpdate || '',\n dto.jobType || '',\n dto.assigneeId || '',\n dto.formId || (dto as any).lastForm || '',\n dto.timeZoneOffset || moment().utcOffset(),\n dto.pendingFields || 0,\n dto.childModified || '',\n dto.version || 0,\n dto.followUpDate || '',\n dto.followUpStatus || '',\n dto.followUpNote || '',\n dto.geoLocation || getEmptyGeoLocation(),\n dto.files || [],\n (dto.fields || []).reduce((p, c) => {\n p[c.controlName.replace('fields.', '')] = c.value;\n return p;\n }, {} as Record<string, FieldValueType>),\n dto.jobEmails || [],\n dto.notes || [],\n dto.reports || [],\n dto.tasks || [],\n dto.instruction || null\n );\n }\n\n static override fromDto(dto: Partial<VasJobDocumentDto>): VasJobDocumentModel {\n\n if (dto.fields !== undefined && !isPlainObject(dto.fields)) {\n throw Error('fields must be an object');\n }\n\n return new VasJobDocumentModel(\n dto.id || '',\n dto.created || '',\n dto.serverCreated || '',\n dto.createdBy || '',\n dto.modified || '',\n dto.serverModified || '',\n dto.modifiedBy || '',\n dto.createdByName || '',\n dto.modifiedByName || '',\n dto.account || '',\n dto.accessGroup || '',\n dto.reference || '',\n dto.jobDate || '',\n dto.jobStatus || '',\n dto.jobStatusLastUpdate || '',\n dto.jobType || '',\n dto.assigneeId || '',\n dto.formId || (dto as any).lastForm || '',\n dto.timeZoneOffset || moment().utcOffset(),\n dto.pendingFields || 0,\n dto.childModified || '',\n dto.version || 0,\n dto.followUpDate || '',\n dto.followUpStatus || '',\n dto.followUpNote || '',\n dto.geoLocation || getEmptyGeoLocation(),\n dto.files || [],\n dto.fields || {},\n dto.jobEmails || [],\n dto.notes || [],\n dto.reports || [],\n dto.tasks || [],\n dto.instruction || null\n );\n }\n\n static empty(): VasJobDocumentModel {\n return new VasJobDocumentModel(\n '', // id\n '', // created\n '', // serverCreated\n '', // createdBy\n '', // modified\n '', // serverModified\n '', // modifiedBy\n '', // createdByName\n '', // modifiedByName\n '', // account\n '', // accessGroup\n '', // reference\n '', // jobDate\n '', // jobStatus\n '', // jobStatusLastUpdate\n '', // jobType\n '', // assigneeId\n '', // formId\n moment().utcOffset(), // timeZoneOffset\n 0, // pendingFields: number,\n '', // childModified: string,\n 0, // version: number,\n '', // followUpDate: string,\n '', // followUpStatus: string,\n '', // followUpNote: string,\n getEmptyGeoLocation(), // geoLocation: GeoLocation,\n [], // files: Array<VasFileDto>,\n {}, // fields: FType,\n [], // jobEmails: Array<VasJobEmailDto>,\n [], // notes: Array<VasNoteDto>,\n [], // reports: Array<VasReportDto>,\n [], // tasks: Array<VasTaskDto>,\n null // instruction: VasInstructionDto | null\n );\n }\n\n public toDto(): VasJobDocumentDto {\n return {\n id: this.id,\n created: this.created,\n createdBy: this.createdBy,\n modified: this.modified,\n modifiedBy: this.modifiedBy,\n serverCreated: this.serverCreated,\n serverModified: this.serverModified,\n createdByName: this.createdByName,\n modifiedByName: this.modifiedByName,\n account: this.account,\n accessGroup: this.accessGroup,\n reference: this.reference,\n jobDate: this.jobDate,\n jobStatus: this.jobStatus,\n jobStatusLastUpdate: this.jobStatusLastUpdate,\n jobType: this.jobType,\n assigneeId: this.assigneeId,\n formId: this.formId,\n timeZoneOffset: this.timeZoneOffset,\n pendingFields: this.pendingFields,\n childModified: this.childModified,\n version: this.version,\n followUpDate: this.followUpDate,\n followUpStatus: this.followUpStatus,\n followUpNote: this.followUpNote,\n geoLocation: this.geoLocation,\n files: this.files,\n fields: this.fields,\n jobEmails: this.jobEmails,\n notes: this.notes,\n reports: this.reports,\n tasks: this.tasks,\n instruction: this.instruction\n };\n }\n}\n\n/** @deprecated use either VasJobDocumentModel or VasJobRelationalModel **/\nexport type VasJobModel = VasJobDocumentModel | VasJobRelationalModel;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EstimateDto, EstimateSummaryDto } from './estimate.dto';
|
|
2
|
+
export interface EstimateControlValueSummaryDto {
|
|
3
|
+
original: EstimateSummaryDto;
|
|
4
|
+
latest: EstimateSummaryDto;
|
|
5
|
+
savings: EstimateSummaryDto;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Describes the value of the estimate control
|
|
9
|
+
*/
|
|
10
|
+
export interface EstimateControlValueDto {
|
|
11
|
+
estimates: Array<EstimateDto>;
|
|
12
|
+
summary: EstimateControlValueSummaryDto;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=estimate-control-value.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-control-value.dto.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-control-value.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC9B,OAAO,EAAE,8BAA8B,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-control-value.dto.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-control-value.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateDto, EstimateSummaryDto } from './estimate.dto';\n\nexport interface EstimateControlValueSummaryDto {\n original: EstimateSummaryDto;\n latest: EstimateSummaryDto;\n savings: EstimateSummaryDto;\n}\n\n/**\n * Describes the value of the estimate control\n */\nexport interface EstimateControlValueDto {\n estimates: Array<EstimateDto>;\n summary: EstimateControlValueSummaryDto;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EstimateControlValueSummaryDto } from './estimate-control-value.dto';
|
|
2
|
+
import { EstimateModel } from './estimate.model';
|
|
3
|
+
/**
|
|
4
|
+
* Utility class for computing the summary value for an estimate control given
|
|
5
|
+
* the first and last estimates
|
|
6
|
+
*/
|
|
7
|
+
export declare class EstimateControlValueModel {
|
|
8
|
+
static calculateSummary(original: EstimateModel, latest: EstimateModel): EstimateControlValueSummaryDto;
|
|
9
|
+
static getEmptySummary(): EstimateControlValueSummaryDto;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=estimate-control-value.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-control-value.model.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-control-value.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD;;;GAGG;AACH,qBAAa,yBAAyB;IAEpC,MAAM,CAAC,gBAAgB,CACrB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,aAAa,GACpB,8BAA8B;IA6BjC,MAAM,CAAC,eAAe,IAAI,8BAA8B;CA8CzD"}
|