@ironcode/vas-lib 3.0.0-alpha.3 → 3.0.0-alpha.6
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/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.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 +9 -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 +25 -13
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +139 -90
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/model/estimate-control/estimate.model.d.ts +1 -1
- package/cjs/lib/model/estimate-control/estimate.model.d.ts.map +1 -1
- package/cjs/lib/model/estimate-control/estimate.model.js +3 -0
- package/cjs/lib/model/estimate-control/estimate.model.js.map +1 -1
- package/cjs/lib/utils/get-value-by-path.d.ts +1 -1
- package/cjs/lib/utils/get-value-by-path.d.ts.map +1 -1
- package/cjs/lib/utils/get-value-by-path.js +4 -4
- package/cjs/lib/utils/get-value-by-path.js.map +1 -1
- package/fesm2022/ironcode-vas-lib.mjs +160 -109
- package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
- package/lib/entity/vas-base.model.d.ts +1 -1
- 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 +9 -3
- package/lib/entity/vas-job.model.d.ts +25 -13
- package/lib/model/estimate-control/estimate.model.d.ts +1 -1
- package/lib/utils/get-value-by-path.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1539,7 +1539,7 @@ class VasFieldModel extends VasJobDataModel {
|
|
|
1539
1539
|
* @return {VasFieldModel}
|
|
1540
1540
|
*/
|
|
1541
1541
|
static fromDto(fieldDto) {
|
|
1542
|
-
return new VasFieldModel(fieldDto.id || '', fieldDto.created || '', fieldDto.serverCreated || '', fieldDto.createdBy || '', fieldDto.modified || '', fieldDto.serverModified || '', fieldDto.modifiedBy || '', fieldDto.createdByName || '', fieldDto.modifiedByName || '', fieldDto.account || '', fieldDto.job || '', fieldDto.control || '', fieldDto.fieldJobPointers || [], fieldDto.value
|
|
1542
|
+
return new VasFieldModel(fieldDto.id || '', fieldDto.created || '', fieldDto.serverCreated || '', fieldDto.createdBy || '', fieldDto.modified || '', fieldDto.serverModified || '', fieldDto.modifiedBy || '', fieldDto.createdByName || '', fieldDto.modifiedByName || '', fieldDto.account || '', fieldDto.job || '', fieldDto.control || '', fieldDto.fieldJobPointers || [], fieldDto.value !== undefined ? fieldDto.value : null, fieldDto.version || 0, fieldDto.controlName || '', fieldDto.controlTitle || '', fieldDto.controlTypeName || '');
|
|
1543
1543
|
}
|
|
1544
1544
|
/**
|
|
1545
1545
|
* @return {VasFieldDto}
|
|
@@ -3311,12 +3311,12 @@ function getValueByPath(path, object) {
|
|
|
3311
3311
|
let scope = object === undefined ? null : object;
|
|
3312
3312
|
let index = 0;
|
|
3313
3313
|
const length = p.length;
|
|
3314
|
-
while (
|
|
3314
|
+
while (index < length) {
|
|
3315
|
+
if (scope === undefined || scope === null) {
|
|
3316
|
+
return undefined;
|
|
3317
|
+
}
|
|
3315
3318
|
scope = scope[p[index++]];
|
|
3316
3319
|
}
|
|
3317
|
-
if (!(index && index == length) || scope === null) {
|
|
3318
|
-
return undefined;
|
|
3319
|
-
}
|
|
3320
3320
|
return scope;
|
|
3321
3321
|
}
|
|
3322
3322
|
|
|
@@ -3551,6 +3551,9 @@ class EstimateModel {
|
|
|
3551
3551
|
}
|
|
3552
3552
|
}
|
|
3553
3553
|
calculate() {
|
|
3554
|
+
if (this.source === 'gtmotive') {
|
|
3555
|
+
return;
|
|
3556
|
+
}
|
|
3554
3557
|
this.summaryNet = this.getSummaryNet(false);
|
|
3555
3558
|
if (this.adjusted) {
|
|
3556
3559
|
this.summaryAdjusted = this.getSummary(this.summaryNet, this.sundryRate, this.sundryMax, this.sundryFixed, this.sundryMethod, this.partsDiscount, this.paintDiscount, this.adjusted);
|
|
@@ -3794,22 +3797,6 @@ const getEmptyGeoLocation = () => ({
|
|
|
3794
3797
|
timestamp: ''
|
|
3795
3798
|
});
|
|
3796
3799
|
|
|
3797
|
-
/**
|
|
3798
|
-
* Try to parse the value as JSON if it looks like a JSON encoded string, return
|
|
3799
|
-
* the original value if it's not a JSON string or parsing fails.
|
|
3800
|
-
*/
|
|
3801
|
-
const tryJson = (value) => {
|
|
3802
|
-
if (typeof value === 'string' && ['{', '['].includes(value.substring(0, 1))) {
|
|
3803
|
-
try {
|
|
3804
|
-
return JSON.parse(value);
|
|
3805
|
-
}
|
|
3806
|
-
catch (e) {
|
|
3807
|
-
return value;
|
|
3808
|
-
}
|
|
3809
|
-
}
|
|
3810
|
-
return value;
|
|
3811
|
-
};
|
|
3812
|
-
|
|
3813
3800
|
/**
|
|
3814
3801
|
* Return true if the argument is a plain object {}, i.e. not an array, null.
|
|
3815
3802
|
*/
|
|
@@ -3818,16 +3805,10 @@ function isPlainObject(value) {
|
|
|
3818
3805
|
}
|
|
3819
3806
|
|
|
3820
3807
|
let jobStaticProps;
|
|
3821
|
-
function getJobStaticProperties() {
|
|
3822
|
-
if (jobStaticProps) {
|
|
3823
|
-
return jobStaticProps;
|
|
3824
|
-
}
|
|
3825
|
-
return jobStaticProps = new Set(Object.getOwnPropertyNames(VasJobModel.empty()));
|
|
3826
|
-
}
|
|
3827
3808
|
/**
|
|
3828
|
-
*
|
|
3809
|
+
* VasJobBaseModel
|
|
3829
3810
|
*/
|
|
3830
|
-
class
|
|
3811
|
+
class VasJobBaseModel extends VasRestrictedAccountObjectModel {
|
|
3831
3812
|
id;
|
|
3832
3813
|
created;
|
|
3833
3814
|
serverCreated;
|
|
@@ -3842,6 +3823,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3842
3823
|
reference;
|
|
3843
3824
|
jobDate;
|
|
3844
3825
|
jobStatus;
|
|
3826
|
+
jobStatusLastUpdate;
|
|
3845
3827
|
jobType;
|
|
3846
3828
|
assigneeId;
|
|
3847
3829
|
formId;
|
|
@@ -3857,7 +3839,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3857
3839
|
reports;
|
|
3858
3840
|
tasks;
|
|
3859
3841
|
instruction;
|
|
3860
|
-
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) {
|
|
3842
|
+
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, reference, jobDate, jobStatus, jobStatusLastUpdate, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, geoLocation, files, fields, jobEmails, notes, reports, tasks, instruction) {
|
|
3861
3843
|
super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup);
|
|
3862
3844
|
this.id = id;
|
|
3863
3845
|
this.created = created;
|
|
@@ -3873,6 +3855,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3873
3855
|
this.reference = reference;
|
|
3874
3856
|
this.jobDate = jobDate;
|
|
3875
3857
|
this.jobStatus = jobStatus;
|
|
3858
|
+
this.jobStatusLastUpdate = jobStatusLastUpdate;
|
|
3876
3859
|
this.jobType = jobType;
|
|
3877
3860
|
this.assigneeId = assigneeId;
|
|
3878
3861
|
this.formId = formId;
|
|
@@ -3902,49 +3885,8 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3902
3885
|
if (jobStaticProps) {
|
|
3903
3886
|
return jobStaticProps;
|
|
3904
3887
|
}
|
|
3905
|
-
return jobStaticProps =
|
|
3906
|
-
|
|
3907
|
-
/**
|
|
3908
|
-
* @return {VasJobModel}
|
|
3909
|
-
*/
|
|
3910
|
-
static empty() {
|
|
3911
|
-
return new VasJobModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment().utcOffset(), 0, '', 0, getEmptyGeoLocation(), [], {}, [], [], [], [], null);
|
|
3912
|
-
}
|
|
3913
|
-
static fromDto(dto) {
|
|
3914
|
-
// we have changed the job model and stopped using the dynamic properties
|
|
3915
|
-
// from form group names to hold fields. Instead, we store a simple object
|
|
3916
|
-
// where the control name (minus the "fields." prefix) is the key, and the
|
|
3917
|
-
// field value is the value. However, we have to cater for data that may
|
|
3918
|
-
// be persisted in the old structure, or an API response where fields is an
|
|
3919
|
-
// array of VasFieldDto.
|
|
3920
|
-
// 1: if dto.fields is already an object, we use the existing value
|
|
3921
|
-
const fields = isPlainObject(dto.fields) ?
|
|
3922
|
-
dto.fields :
|
|
3923
|
-
{};
|
|
3924
|
-
// 2: if dto.fields is an array, we're handling a vas-rest response, we
|
|
3925
|
-
// iterate over the fields and update the fields object.
|
|
3926
|
-
Array.isArray(dto.fields) && dto.fields.forEach((field) => {
|
|
3927
|
-
fields[field.controlName.replace('fields.', '')] = tryJson(field.value);
|
|
3928
|
-
});
|
|
3929
|
-
// 3: if `fields` still has no keys, we're restoring a VasJobDto object that
|
|
3930
|
-
// was saved in the old "form-group" style, where dynamic keys are
|
|
3931
|
-
// derived from the form-group names. We'll iterate over those keys, and
|
|
3932
|
-
// update the `fields` object. Once this model is serialized back to a
|
|
3933
|
-
// dto, it will have the new shape.
|
|
3934
|
-
if (Object.keys(fields).length === 0) {
|
|
3935
|
-
Object
|
|
3936
|
-
.keys(dto)
|
|
3937
|
-
.filter(key => !getJobStaticProperties().has(key))
|
|
3938
|
-
.forEach(groupName => {
|
|
3939
|
-
Object
|
|
3940
|
-
.keys(dto[groupName])
|
|
3941
|
-
.forEach(controlName => {
|
|
3942
|
-
const cn = controlName.replace('fields.', '');
|
|
3943
|
-
fields[cn] = dto[groupName][controlName];
|
|
3944
|
-
});
|
|
3945
|
-
});
|
|
3946
|
-
}
|
|
3947
|
-
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 || moment().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], fields, dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
3888
|
+
return jobStaticProps =
|
|
3889
|
+
new Set(Object.getOwnPropertyNames(VasJobDocumentModel.empty()));
|
|
3948
3890
|
}
|
|
3949
3891
|
/**
|
|
3950
3892
|
* Returns an object describing how many attachments were added to this job
|
|
@@ -3985,39 +3927,6 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3985
3927
|
getValueByPath(path = []) {
|
|
3986
3928
|
return getValueByPath(Array.isArray(path) ? path : path.split('.'), this);
|
|
3987
3929
|
}
|
|
3988
|
-
toDto() {
|
|
3989
|
-
return {
|
|
3990
|
-
id: this.id,
|
|
3991
|
-
created: this.created,
|
|
3992
|
-
createdBy: this.createdBy,
|
|
3993
|
-
modified: this.modified,
|
|
3994
|
-
modifiedBy: this.modifiedBy,
|
|
3995
|
-
serverCreated: this.serverCreated,
|
|
3996
|
-
serverModified: this.serverModified,
|
|
3997
|
-
createdByName: this.createdByName,
|
|
3998
|
-
modifiedByName: this.modifiedByName,
|
|
3999
|
-
account: this.account,
|
|
4000
|
-
accessGroup: this.accessGroup,
|
|
4001
|
-
reference: this.reference,
|
|
4002
|
-
jobDate: this.jobDate,
|
|
4003
|
-
jobStatus: this.jobStatus,
|
|
4004
|
-
jobType: this.jobType,
|
|
4005
|
-
assigneeId: this.assigneeId,
|
|
4006
|
-
formId: this.formId,
|
|
4007
|
-
timeZoneOffset: this.timeZoneOffset,
|
|
4008
|
-
pendingFields: this.pendingFields,
|
|
4009
|
-
childModified: this.childModified,
|
|
4010
|
-
version: this.version,
|
|
4011
|
-
geoLocation: this.geoLocation,
|
|
4012
|
-
files: this.files,
|
|
4013
|
-
fields: this.fields,
|
|
4014
|
-
jobEmails: this.jobEmails,
|
|
4015
|
-
notes: this.notes,
|
|
4016
|
-
reports: this.reports,
|
|
4017
|
-
tasks: this.tasks,
|
|
4018
|
-
instruction: this.instruction
|
|
4019
|
-
};
|
|
4020
|
-
}
|
|
4021
3930
|
/**
|
|
4022
3931
|
* This method will parse a syntax that allows us to build strings from the
|
|
4023
3932
|
* values of from the job model. For example if the job model was:
|
|
@@ -4076,8 +3985,8 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
4076
3985
|
if (objectKey === 'job') {
|
|
4077
3986
|
result = (this.getValueByPath(path) || '').toString();
|
|
4078
3987
|
}
|
|
4079
|
-
else if (objectKey === 'fields'
|
|
4080
|
-
result = (getValueByPath(
|
|
3988
|
+
else if (objectKey === 'fields') {
|
|
3989
|
+
result = (this.getValueByPath(['fields', ...path]) || '').toString();
|
|
4081
3990
|
}
|
|
4082
3991
|
else if (objectKey.length && options.objects && options.objects[objectKey] !== undefined) {
|
|
4083
3992
|
result = (getValueByPath(path, options.objects[objectKey]) || '').toString();
|
|
@@ -4139,6 +4048,132 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
4139
4048
|
]);
|
|
4140
4049
|
}
|
|
4141
4050
|
}
|
|
4051
|
+
class VasJobRelationalModel extends VasJobBaseModel {
|
|
4052
|
+
getValueByPath(path = []) {
|
|
4053
|
+
const parts = Array.isArray(path) ? path : path.split('.');
|
|
4054
|
+
if (parts[0] === 'fields') {
|
|
4055
|
+
return this.getFieldValueByPath(parts[1], parts.slice(2));
|
|
4056
|
+
}
|
|
4057
|
+
return getValueByPath(parts, this);
|
|
4058
|
+
}
|
|
4059
|
+
getFieldsMap() {
|
|
4060
|
+
return this.fields.reduce((p, c) => {
|
|
4061
|
+
p[c.controlName] = c.value;
|
|
4062
|
+
return p;
|
|
4063
|
+
}, {});
|
|
4064
|
+
}
|
|
4065
|
+
getFieldValueByPath(controlName, path) {
|
|
4066
|
+
for (const field of this.fields) {
|
|
4067
|
+
if (field.controlName === controlName) {
|
|
4068
|
+
if (path.length === 0) {
|
|
4069
|
+
return field.value;
|
|
4070
|
+
}
|
|
4071
|
+
if (field.value === null) {
|
|
4072
|
+
return path.length >= 1 ? undefined : null;
|
|
4073
|
+
}
|
|
4074
|
+
if (isPlainObject(field.value)) {
|
|
4075
|
+
return getValueByPath(path, field.value);
|
|
4076
|
+
}
|
|
4077
|
+
return undefined;
|
|
4078
|
+
}
|
|
4079
|
+
}
|
|
4080
|
+
return undefined;
|
|
4081
|
+
}
|
|
4082
|
+
static fromDto(dto) {
|
|
4083
|
+
if (dto.fields !== undefined && !Array.isArray(dto.fields)) {
|
|
4084
|
+
throw Error('fields must be an array');
|
|
4085
|
+
}
|
|
4086
|
+
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 || moment().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], (dto.fields || []).map(f => VasFieldModel.fromDto(f)), dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
4087
|
+
}
|
|
4088
|
+
static empty() {
|
|
4089
|
+
return new VasJobRelationalModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment().utcOffset(), 0, '', 0, getEmptyGeoLocation(), [], [], [], [], [], [], null);
|
|
4090
|
+
}
|
|
4091
|
+
toDto() {
|
|
4092
|
+
return {
|
|
4093
|
+
id: this.id,
|
|
4094
|
+
created: this.created,
|
|
4095
|
+
createdBy: this.createdBy,
|
|
4096
|
+
modified: this.modified,
|
|
4097
|
+
modifiedBy: this.modifiedBy,
|
|
4098
|
+
serverCreated: this.serverCreated,
|
|
4099
|
+
serverModified: this.serverModified,
|
|
4100
|
+
createdByName: this.createdByName,
|
|
4101
|
+
modifiedByName: this.modifiedByName,
|
|
4102
|
+
account: this.account,
|
|
4103
|
+
accessGroup: this.accessGroup,
|
|
4104
|
+
reference: this.reference,
|
|
4105
|
+
jobDate: this.jobDate,
|
|
4106
|
+
jobStatus: this.jobStatus,
|
|
4107
|
+
jobStatusLastUpdate: this.jobStatusLastUpdate,
|
|
4108
|
+
jobType: this.jobType,
|
|
4109
|
+
assigneeId: this.assigneeId,
|
|
4110
|
+
formId: this.formId,
|
|
4111
|
+
timeZoneOffset: this.timeZoneOffset,
|
|
4112
|
+
pendingFields: this.pendingFields,
|
|
4113
|
+
childModified: this.childModified,
|
|
4114
|
+
version: this.version,
|
|
4115
|
+
geoLocation: this.geoLocation,
|
|
4116
|
+
files: this.files,
|
|
4117
|
+
fields: this.fields.map(f => f.toDto()),
|
|
4118
|
+
jobEmails: this.jobEmails,
|
|
4119
|
+
notes: this.notes,
|
|
4120
|
+
reports: this.reports,
|
|
4121
|
+
tasks: this.tasks,
|
|
4122
|
+
instruction: this.instruction
|
|
4123
|
+
};
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
class VasJobDocumentModel extends VasJobBaseModel {
|
|
4127
|
+
static fromRelationalDto(dto) {
|
|
4128
|
+
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 || moment().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], (dto.fields || []).reduce((p, c) => {
|
|
4129
|
+
p[c.controlName.replace('fields.', '')] = c.value;
|
|
4130
|
+
return p;
|
|
4131
|
+
}, {}), dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
4132
|
+
}
|
|
4133
|
+
static fromDto(dto) {
|
|
4134
|
+
if (dto.fields !== undefined && !isPlainObject(dto.fields)) {
|
|
4135
|
+
throw Error('fields must be an object');
|
|
4136
|
+
}
|
|
4137
|
+
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 || moment().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], dto.fields || {}, dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
4138
|
+
}
|
|
4139
|
+
static empty() {
|
|
4140
|
+
return new VasJobDocumentModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment().utcOffset(), 0, '', 0, getEmptyGeoLocation(), [], {}, [], [], [], [], null);
|
|
4141
|
+
}
|
|
4142
|
+
toDto() {
|
|
4143
|
+
return {
|
|
4144
|
+
id: this.id,
|
|
4145
|
+
created: this.created,
|
|
4146
|
+
createdBy: this.createdBy,
|
|
4147
|
+
modified: this.modified,
|
|
4148
|
+
modifiedBy: this.modifiedBy,
|
|
4149
|
+
serverCreated: this.serverCreated,
|
|
4150
|
+
serverModified: this.serverModified,
|
|
4151
|
+
createdByName: this.createdByName,
|
|
4152
|
+
modifiedByName: this.modifiedByName,
|
|
4153
|
+
account: this.account,
|
|
4154
|
+
accessGroup: this.accessGroup,
|
|
4155
|
+
reference: this.reference,
|
|
4156
|
+
jobDate: this.jobDate,
|
|
4157
|
+
jobStatus: this.jobStatus,
|
|
4158
|
+
jobStatusLastUpdate: this.jobStatusLastUpdate,
|
|
4159
|
+
jobType: this.jobType,
|
|
4160
|
+
assigneeId: this.assigneeId,
|
|
4161
|
+
formId: this.formId,
|
|
4162
|
+
timeZoneOffset: this.timeZoneOffset,
|
|
4163
|
+
pendingFields: this.pendingFields,
|
|
4164
|
+
childModified: this.childModified,
|
|
4165
|
+
version: this.version,
|
|
4166
|
+
geoLocation: this.geoLocation,
|
|
4167
|
+
files: this.files,
|
|
4168
|
+
fields: this.fields,
|
|
4169
|
+
jobEmails: this.jobEmails,
|
|
4170
|
+
notes: this.notes,
|
|
4171
|
+
reports: this.reports,
|
|
4172
|
+
tasks: this.tasks,
|
|
4173
|
+
instruction: this.instruction
|
|
4174
|
+
};
|
|
4175
|
+
}
|
|
4176
|
+
}
|
|
4142
4177
|
|
|
4143
4178
|
class VasLookupTypeModel extends VasAccountObjectModel {
|
|
4144
4179
|
id;
|
|
@@ -4772,9 +4807,25 @@ const omit = (obj, omitKey) => {
|
|
|
4772
4807
|
}, {});
|
|
4773
4808
|
};
|
|
4774
4809
|
|
|
4810
|
+
/**
|
|
4811
|
+
* Try to parse the value as JSON if it looks like a JSON encoded string, return
|
|
4812
|
+
* the original value if it's not a JSON string or parsing fails.
|
|
4813
|
+
*/
|
|
4814
|
+
const tryJson = (value) => {
|
|
4815
|
+
if (typeof value === 'string' && ['{', '['].includes(value.substring(0, 1))) {
|
|
4816
|
+
try {
|
|
4817
|
+
return JSON.parse(value);
|
|
4818
|
+
}
|
|
4819
|
+
catch (e) {
|
|
4820
|
+
return value;
|
|
4821
|
+
}
|
|
4822
|
+
}
|
|
4823
|
+
return value;
|
|
4824
|
+
};
|
|
4825
|
+
|
|
4775
4826
|
/**
|
|
4776
4827
|
* Generated bundle index. Do not edit.
|
|
4777
4828
|
*/
|
|
4778
4829
|
|
|
4779
|
-
export { EstimateControlValueModel, EstimateItemModel, EstimateModel, VasAccessGroupModel, VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasContactTypeModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobActionControlsStepModel, VasJobActionEmailFormStepModel, VasJobActionInstructionStepModel, VasJobActionModel, VasJobActionNotePromptStepModel, VasJobActionSetDatetimeStepModel, VasJobActionSetJobStatusStepModel, VasJobActionSetValueStepModel, VasJobActionWebhookStepModel, VasJobCopyModel, VasJobDataModel, VasJobEmailModel,
|
|
4830
|
+
export { EstimateControlValueModel, EstimateItemModel, EstimateModel, VasAccessGroupModel, VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasContactTypeModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobActionControlsStepModel, VasJobActionEmailFormStepModel, VasJobActionInstructionStepModel, VasJobActionModel, VasJobActionNotePromptStepModel, VasJobActionSetDatetimeStepModel, VasJobActionSetJobStatusStepModel, VasJobActionSetValueStepModel, VasJobActionWebhookStepModel, VasJobBaseModel, VasJobCopyModel, VasJobDataModel, VasJobDocumentModel, VasJobEmailModel, VasJobRelationalModel, VasJobStatusModel, VasJobTypeModel, VasLookupModel, VasLookupTypeModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasTaskTypeModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, getValueByPath, isArrayString, isCameraControlValueV1, isCameraControlValueV2, isFileDto, isJobAutomationStep, isJobControlsStep, isJobEmailFormStep, isJobInstructionStep, isJobNotePromptStep, isJobSetDatetimeStep, isJobSetJobStatusStep, isJobSetValueStep, isJobWebhookStep, isNumeric, isPlainObject, omit, only, prepareFieldApiValue, stepModelFactory, tryJson };
|
|
4780
4831
|
//# sourceMappingURL=ironcode-vas-lib.mjs.map
|