@ironcode/vas-lib 1.1.0 → 1.3.0
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/index.d.ts +2 -0
- package/cjs/lib/entity/index.d.ts.map +1 -1
- package/cjs/lib/entity/index.js +2 -0
- package/cjs/lib/entity/index.js.map +1 -1
- package/cjs/lib/entity/vas-job.model.d.ts +55 -66
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +92 -69
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/entity/vas-vehicle.dto.d.ts +7 -0
- package/cjs/lib/entity/vas-vehicle.dto.d.ts.map +1 -0
- package/cjs/lib/entity/vas-vehicle.dto.js +3 -0
- package/cjs/lib/entity/vas-vehicle.dto.js.map +1 -0
- package/cjs/lib/entity/vas-vehicle.model.d.ts +22 -0
- package/cjs/lib/entity/vas-vehicle.model.d.ts.map +1 -0
- package/cjs/lib/entity/vas-vehicle.model.js +55 -0
- package/cjs/lib/entity/vas-vehicle.model.js.map +1 -0
- package/cjs/package.json +16 -6
- package/esm2020/lib/entity/index.mjs +3 -1
- package/esm2020/lib/entity/vas-job.model.mjs +92 -70
- package/esm2020/lib/entity/vas-vehicle.dto.mjs +2 -0
- package/esm2020/lib/entity/vas-vehicle.model.mjs +51 -0
- package/fesm2015/ironcode-vas-lib.mjs +143 -70
- package/fesm2015/ironcode-vas-lib.mjs.map +1 -1
- package/fesm2020/ironcode-vas-lib.mjs +142 -70
- package/fesm2020/ironcode-vas-lib.mjs.map +1 -1
- package/lib/entity/index.d.ts +2 -0
- package/lib/entity/vas-job.model.d.ts +55 -66
- package/lib/entity/vas-vehicle.dto.d.ts +6 -0
- package/lib/entity/vas-vehicle.model.d.ts +21 -0
- package/package.json +1 -1
|
@@ -57,4 +57,6 @@ export * from './vas-user.dto';
|
|
|
57
57
|
export * from './vas-user.model';
|
|
58
58
|
export * from './vas-form-config.dto';
|
|
59
59
|
export * from './vas-account-config.dto';
|
|
60
|
+
export * from './vas-vehicle.dto';
|
|
61
|
+
export * from './vas-vehicle.model';
|
|
60
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/cjs/lib/entity/index.js
CHANGED
|
@@ -60,4 +60,6 @@ tslib_1.__exportStar(require("./vas-user.dto"), exports);
|
|
|
60
60
|
tslib_1.__exportStar(require("./vas-user.model"), exports);
|
|
61
61
|
tslib_1.__exportStar(require("./vas-form-config.dto"), exports);
|
|
62
62
|
tslib_1.__exportStar(require("./vas-account-config.dto"), exports);
|
|
63
|
+
tslib_1.__exportStar(require("./vas-vehicle.dto"), exports);
|
|
64
|
+
tslib_1.__exportStar(require("./vas-vehicle.model"), exports);
|
|
63
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,gEAAsC;AACtC,iEAAuC;AACvC,4DAAkC;AAClC,mEAAyC;AACzC,qEAA2C;AAC3C,yDAA+B;AAC/B,2DAAiC;AACjC,2DAAiC;AACjC,6DAAmC;AACnC,4DAAkC;AAClC,8DAAoC;AACpC,iEAAuC;AACvC,4DAAkC;AAClC,8DAAoC;AACpC,iEAAuC;AACvC,mEAAyC;AACzC,0DAAgC;AAChC,4DAAkC;AAClC,yDAA+B;AAC/B,2DAAiC;AACjC,yDAA+B;AAC/B,2DAAiC;AACjC,2DAAiC;AACjC,0DAAgC;AAChC,4DAAkC;AAClC,gEAAsC;AACtC,kEAAwC;AACxC,oEAAyC;AACzC,sEAA4C;AAC5C,0EAAgD;AAChD,4EAAkD;AAClD,yEAA+C;AAC/C,2EAAiD;AACjD,6DAAmC;AACnC,+DAAqC;AACrC,wDAA8B;AAC9B,0DAAgC;AAChC,+DAAqC;AACrC,6DAAmC;AACnC,2DAAiC;AACjC,gEAAsC;AACtC,+DAAqC;AACrC,iEAAuC;AACvC,yDAA+B;AAC/B,2DAAiC;AACjC,2DAAiC;AACjC,6DAAmC;AACnC,kEAAwC;AACxC,oEAA0C;AAC1C,mEAAyC;AACzC,qEAA2C;AAC3C,8EAAoD;AACpD,gFAAsD;AACtD,8DAAoC;AACpC,yDAA+B;AAC/B,2DAAiC;AACjC,gEAAsC;AACtC,mEAAyC","sourcesContent":["export * from './vas-fire-user.dto';\nexport * from './vas-fire-user.model';\nexport * from './vas-access-group.dto';\nexport * from './vas-account.dto';\nexport * from './vas-account-object.dto';\nexport * from './vas-account-object.model';\nexport * from './vas-base.dto';\nexport * from './vas-base.model';\nexport * from './vas-branch.dto';\nexport * from './vas-branch.model';\nexport * from './vas-contact.dto';\nexport * from './vas-contact.model';\nexport * from './vas-contact-type.dto';\nexport * from './vas-control.dto';\nexport * from './vas-control.model';\nexport * from './vas-control-type.dto';\nexport * from './vas-control-type.model';\nexport * from './vas-field.dto';\nexport * from './vas-field.model';\nexport * from './vas-file.dto';\nexport * from './vas-file.model';\nexport * from './vas-form.dto';\nexport * from './vas-form.model';\nexport * from './vas-invitation';\nexport * from './vas-group.dto';\nexport * from './vas-group.model';\nexport * from './vas-instruction.dto';\nexport * from './vas-instruction.model';\nexport * from './vas-instruction-job.dto'\nexport * from './vas-instruction-job.model';\nexport * from './vas-instruction-job-field.dto';\nexport * from './vas-instruction-job-field.model';\nexport * from './vas-instruction-provider.dto';\nexport * from './vas-instruction-provider.model';\nexport * from './vas-job-data.dto';\nexport * from './vas-job-data.model';\nexport * from './vas-job.dto';\nexport * from './vas-job.model';\nexport * from './vas-job-status.dto';\nexport * from './vas-job-type.dto';\nexport * from './vas-lookup.dto';\nexport * from './vas-lookup-type.dto';\nexport * from './vas-membership.dto';\nexport * from './vas-membership.model';\nexport * from './vas-note.dto';\nexport * from './vas-note.model';\nexport * from './vas-report.dto';\nexport * from './vas-report.model';\nexport * from './vas-report-layout.dto';\nexport * from './vas-report-layout.model';\nexport * from './vas-report-request.dto';\nexport * from './vas-report-request.model';\nexport * from './vas-restricted-account-object.dto';\nexport * from './vas-restricted-account-object.model';\nexport * from './vas-task-type.dto';\nexport * from './vas-user.dto';\nexport * from './vas-user.model';\nexport * from './vas-form-config.dto';\nexport * from './vas-account-config.dto';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,gEAAsC;AACtC,iEAAuC;AACvC,4DAAkC;AAClC,mEAAyC;AACzC,qEAA2C;AAC3C,yDAA+B;AAC/B,2DAAiC;AACjC,2DAAiC;AACjC,6DAAmC;AACnC,4DAAkC;AAClC,8DAAoC;AACpC,iEAAuC;AACvC,4DAAkC;AAClC,8DAAoC;AACpC,iEAAuC;AACvC,mEAAyC;AACzC,0DAAgC;AAChC,4DAAkC;AAClC,yDAA+B;AAC/B,2DAAiC;AACjC,yDAA+B;AAC/B,2DAAiC;AACjC,2DAAiC;AACjC,0DAAgC;AAChC,4DAAkC;AAClC,gEAAsC;AACtC,kEAAwC;AACxC,oEAAyC;AACzC,sEAA4C;AAC5C,0EAAgD;AAChD,4EAAkD;AAClD,yEAA+C;AAC/C,2EAAiD;AACjD,6DAAmC;AACnC,+DAAqC;AACrC,wDAA8B;AAC9B,0DAAgC;AAChC,+DAAqC;AACrC,6DAAmC;AACnC,2DAAiC;AACjC,gEAAsC;AACtC,+DAAqC;AACrC,iEAAuC;AACvC,yDAA+B;AAC/B,2DAAiC;AACjC,2DAAiC;AACjC,6DAAmC;AACnC,kEAAwC;AACxC,oEAA0C;AAC1C,mEAAyC;AACzC,qEAA2C;AAC3C,8EAAoD;AACpD,gFAAsD;AACtD,8DAAoC;AACpC,yDAA+B;AAC/B,2DAAiC;AACjC,gEAAsC;AACtC,mEAAyC;AACzC,4DAAkC;AAClC,8DAAoC","sourcesContent":["export * from './vas-fire-user.dto';\nexport * from './vas-fire-user.model';\nexport * from './vas-access-group.dto';\nexport * from './vas-account.dto';\nexport * from './vas-account-object.dto';\nexport * from './vas-account-object.model';\nexport * from './vas-base.dto';\nexport * from './vas-base.model';\nexport * from './vas-branch.dto';\nexport * from './vas-branch.model';\nexport * from './vas-contact.dto';\nexport * from './vas-contact.model';\nexport * from './vas-contact-type.dto';\nexport * from './vas-control.dto';\nexport * from './vas-control.model';\nexport * from './vas-control-type.dto';\nexport * from './vas-control-type.model';\nexport * from './vas-field.dto';\nexport * from './vas-field.model';\nexport * from './vas-file.dto';\nexport * from './vas-file.model';\nexport * from './vas-form.dto';\nexport * from './vas-form.model';\nexport * from './vas-invitation';\nexport * from './vas-group.dto';\nexport * from './vas-group.model';\nexport * from './vas-instruction.dto';\nexport * from './vas-instruction.model';\nexport * from './vas-instruction-job.dto'\nexport * from './vas-instruction-job.model';\nexport * from './vas-instruction-job-field.dto';\nexport * from './vas-instruction-job-field.model';\nexport * from './vas-instruction-provider.dto';\nexport * from './vas-instruction-provider.model';\nexport * from './vas-job-data.dto';\nexport * from './vas-job-data.model';\nexport * from './vas-job.dto';\nexport * from './vas-job.model';\nexport * from './vas-job-status.dto';\nexport * from './vas-job-type.dto';\nexport * from './vas-lookup.dto';\nexport * from './vas-lookup-type.dto';\nexport * from './vas-membership.dto';\nexport * from './vas-membership.model';\nexport * from './vas-note.dto';\nexport * from './vas-note.model';\nexport * from './vas-report.dto';\nexport * from './vas-report.model';\nexport * from './vas-report-layout.dto';\nexport * from './vas-report-layout.model';\nexport * from './vas-report-request.dto';\nexport * from './vas-report-request.model';\nexport * from './vas-restricted-account-object.dto';\nexport * from './vas-restricted-account-object.model';\nexport * from './vas-task-type.dto';\nexport * from './vas-user.dto';\nexport * from './vas-user.model';\nexport * from './vas-form-config.dto';\nexport * from './vas-account-config.dto';\nexport * from './vas-vehicle.dto';\nexport * from './vas-vehicle.model';\n"]}
|
|
@@ -5,6 +5,7 @@ import { VasFormModel } from './vas-form.model';
|
|
|
5
5
|
import { VasJobDto } from './vas-job.dto';
|
|
6
6
|
import { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';
|
|
7
7
|
import { GeoLocation } from '../model/geo-location';
|
|
8
|
+
import { VasFormDto } from './vas-form.dto';
|
|
8
9
|
export declare interface VasJobModelDynamicInterface {
|
|
9
10
|
[s: string]: string | number | Record<string, VasFieldDtoValue>;
|
|
10
11
|
}
|
|
@@ -54,8 +55,7 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
54
55
|
*/
|
|
55
56
|
get dynamicProperties(): Array<string>;
|
|
56
57
|
/**
|
|
57
|
-
* Returns
|
|
58
|
-
* the type
|
|
58
|
+
* Returns the list of properties of the Job type
|
|
59
59
|
*/
|
|
60
60
|
get staticProperties(): Array<string>;
|
|
61
61
|
/**
|
|
@@ -63,6 +63,13 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
63
63
|
*/
|
|
64
64
|
static empty(): VasJobModel;
|
|
65
65
|
static fromDto(dto: Partial<VasJobDto>): VasJobModel;
|
|
66
|
+
/**
|
|
67
|
+
* This method will instantiate a new JobModel. The difference with this
|
|
68
|
+
* method of instantiation is that we are coming from a relation frame i.e.
|
|
69
|
+
* the job has a list of {@link VasFieldDto} instead of a Job document.
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
static fromRelational(dto: Partial<VasJobDto>, form: VasFormDto): VasJobModel;
|
|
66
73
|
/**
|
|
67
74
|
* @param {VasFormModel} formModel
|
|
68
75
|
* @return {Record<string, VasFieldDtoValue>}
|
|
@@ -75,7 +82,7 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
75
82
|
* return a property regardless (because it uses the form to drive the logic)
|
|
76
83
|
* @return {Record<string, VasFieldDtoValue>}
|
|
77
84
|
*/
|
|
78
|
-
getFields2(): Record<string, VasFieldDtoValue>;
|
|
85
|
+
protected getFields2(): Record<string, VasFieldDtoValue>;
|
|
79
86
|
/**
|
|
80
87
|
* Returns an object describing how many attachments were added to this job
|
|
81
88
|
* (camera controls and files), and how many have not been uploaded yet.
|
|
@@ -88,18 +95,41 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
88
95
|
total: number;
|
|
89
96
|
};
|
|
90
97
|
/**
|
|
91
|
-
* This method will
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
* This method will return the dynamic property from the JobModel that
|
|
99
|
+
* represent a group (from a form).
|
|
100
|
+
*
|
|
101
|
+
* @param name the name of the group
|
|
102
|
+
* @param init if true (default) and group is not found, initialise an empty
|
|
103
|
+
* group, otherwise throw an error
|
|
104
|
+
*/
|
|
105
|
+
getGroup(name: string, init?: boolean): Record<string, VasFieldDtoValue>;
|
|
106
|
+
/**
|
|
107
|
+
* @param path path segments
|
|
108
|
+
*/
|
|
109
|
+
getValueByPath<T extends VasFieldDtoValue>(path?: string[]): T | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* In order to understand why we need this method it is important to
|
|
112
|
+
* understand that within the system, Jobs can be represented in one of two
|
|
113
|
+
* ways, document and relational.
|
|
114
|
+
*
|
|
115
|
+
* The important distinction is how values submitted by a form are stored.
|
|
116
|
+
*
|
|
117
|
+
* Jobs stored as documents (JSON objects) will store user values, as dynamic
|
|
118
|
+
* properties of the document.
|
|
119
|
+
*
|
|
120
|
+
* Whereas, Jobs stored as relational, will store user values in an array of
|
|
121
|
+
* {@link VasFieldDto} objects.
|
|
122
|
+
*
|
|
123
|
+
* Depending on where we are in the system, either one of these approaches can
|
|
124
|
+
* be more useful than the other.
|
|
125
|
+
*
|
|
126
|
+
* This method, assumes that the JobModel has been instantiated from a
|
|
127
|
+
* document representation, and serves to hydrate the fields array. In order
|
|
128
|
+
* to achieve this, knowledge of the {@link VasFormDto} that created the job
|
|
129
|
+
* is required.
|
|
130
|
+
*
|
|
131
|
+
*
|
|
132
|
+
* Job in document representation
|
|
103
133
|
* {
|
|
104
134
|
* id: <guid>,
|
|
105
135
|
* reference: "something"
|
|
@@ -109,7 +139,7 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
109
139
|
* }
|
|
110
140
|
* }
|
|
111
141
|
*
|
|
112
|
-
*
|
|
142
|
+
* Job in relational representation
|
|
113
143
|
* {
|
|
114
144
|
* id: <guid>,
|
|
115
145
|
* reference: "something"
|
|
@@ -124,55 +154,15 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
124
154
|
* ]
|
|
125
155
|
* }
|
|
126
156
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* and the Field that was created in the Job to store the value for that
|
|
133
|
-
* Control. This is useful, if for example you want to compare a Job in form A
|
|
134
|
-
* with a Job in form B, for example if you want to update the Job on the API
|
|
135
|
-
* with a Job that was saved by a client in form A.
|
|
136
|
-
*
|
|
137
|
-
* E.g.
|
|
138
|
-
* Client -> API: client requests form
|
|
139
|
-
* User -> Client: user fills in the form and submits
|
|
140
|
-
* Client -> Firestore: client saves the Job in form A i.e. dynamic props
|
|
141
|
-
* Firestore -> Function: A function is triggered to sync the job to the API
|
|
142
|
-
* Function -> API: Function checks if job already exists, it receives 404
|
|
143
|
-
* Function -> Function: The function calls `hydrateFields(...)`
|
|
144
|
-
* Function -> API: The function POST the Job to /jobs
|
|
145
|
-
* Function -> API: The function POST each field to /fields
|
|
146
|
-
*
|
|
147
|
-
* Similarly, if the user updates the job
|
|
148
|
-
* Client -> API: client requests form
|
|
149
|
-
* User -> Client: user fills in the form and submits an update
|
|
150
|
-
* Client -> Firestore: client saves the Job in form A i.e. dynamic props
|
|
151
|
-
* Firestore -> Function: A function is triggered to sync the job to the API
|
|
152
|
-
* Function -> API: Function checks if job already exists, it receives 200
|
|
153
|
-
* Function -> Function: The function calls `hydrateFields(...)` passing in
|
|
154
|
-
* the map is made by iterating over the fields it
|
|
155
|
-
* received from the API and storing the mappings
|
|
156
|
-
* between controlId and fieldId for each field
|
|
157
|
-
* Function -> API: The function PATCH the Job to /jobs
|
|
158
|
-
* Function -> API: The function POST/PATCH each field to /fields
|
|
159
|
-
* treated as new
|
|
160
|
-
*
|
|
161
|
-
* @param {VasFormModel} formModel the VasFormModel that was used to create
|
|
162
|
-
* the job
|
|
163
|
-
* @param {Map<string, string>} controlFieldIdMap a mapping of control to
|
|
164
|
-
* field ids. This is used to determine whether a new id for the field should
|
|
165
|
-
* be generated, or to reuse an existing one from the map.
|
|
166
|
-
* @param {Array<string>} controlNames if a value is provided, it will be used
|
|
157
|
+
*
|
|
158
|
+
* @param formModel the VasFormModel that was used to create the job
|
|
159
|
+
* @param controlFieldIdMap This is used to determine the id each field.
|
|
160
|
+
* Either one will be found in the map, or a new one is generated.
|
|
161
|
+
* @param controlNames if a value is provided, it will be used
|
|
167
162
|
* to filter the fields that are returned.
|
|
168
163
|
* @return {Array<VasFieldDto>}
|
|
169
164
|
*/
|
|
170
165
|
hydrateFields(formModel: VasFormModel, controlFieldIdMap?: Map<string, string>, controlNames?: Array<string>): void;
|
|
171
|
-
/**
|
|
172
|
-
* @param {string[]} path path segments
|
|
173
|
-
* @return {void}
|
|
174
|
-
*/
|
|
175
|
-
getValueByPath<T extends VasFieldDtoValue>(path?: string[]): T | undefined;
|
|
176
166
|
/**
|
|
177
167
|
* A very non sophisticated way to set values in the job via paths
|
|
178
168
|
*
|
|
@@ -187,14 +177,13 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
187
177
|
* }
|
|
188
178
|
* }
|
|
189
179
|
*
|
|
190
|
-
* @param
|
|
191
|
-
* @param
|
|
180
|
+
* @param value the value to set
|
|
181
|
+
* @param path path segments
|
|
192
182
|
*/
|
|
193
183
|
setValueByPath(value: VasFieldDtoValue, path?: string[]): void;
|
|
194
184
|
/**
|
|
195
|
-
* @param
|
|
185
|
+
* @param staticOnly if true, will only output values for the static
|
|
196
186
|
* properties in the dto
|
|
197
|
-
* @return {VasJobDto}
|
|
198
187
|
*/
|
|
199
188
|
toDto(staticOnly?: boolean): VasJobDto;
|
|
200
189
|
/**
|
|
@@ -221,7 +210,7 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
221
210
|
*
|
|
222
211
|
* @param {string} value a string with the syntax
|
|
223
212
|
* @param {ParseSyntaxOptions} options
|
|
224
|
-
* @return
|
|
213
|
+
* @return the results of parsing the syntax on this job
|
|
225
214
|
*/
|
|
226
215
|
parseSyntax(value: string, options?: ParseSyntaxOptions): string;
|
|
227
216
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-job.model.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"vas-job.model.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.model.ts"],"names":[],"mappings":"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"}
|
|
@@ -62,8 +62,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
62
62
|
.filter(prop => !nativeProps.includes(prop));
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Returns
|
|
66
|
-
* the type
|
|
65
|
+
* Returns the list of properties of the Job type
|
|
67
66
|
*/
|
|
68
67
|
get staticProperties() {
|
|
69
68
|
return Object.getOwnPropertyNames(VasJobModel.empty());
|
|
@@ -83,6 +82,28 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
83
82
|
.forEach((key) => model.$this[key] = dto[key]);
|
|
84
83
|
return model;
|
|
85
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* This method will instantiate a new JobModel. The difference with this
|
|
87
|
+
* method of instantiation is that we are coming from a relation frame i.e.
|
|
88
|
+
* the job has a list of {@link VasFieldDto} instead of a Job document.
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
static fromRelational(dto, form) {
|
|
92
|
+
const model = 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.timeZoneOffset || (0, moment_1.default)().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.fields || [], dto.files || [], dto.createdByDisplayName || '', dto.modifiedByDisplayName || '', dto.geoLocation || (0, geo_location_1.getEmptyGeoLocation)());
|
|
93
|
+
form.groups
|
|
94
|
+
.forEach(group => {
|
|
95
|
+
group.controls
|
|
96
|
+
.forEach(control => {
|
|
97
|
+
var _a;
|
|
98
|
+
const field = (_a = dto.fields) === null || _a === void 0 ? void 0 : _a.find(f => f.control === control.id);
|
|
99
|
+
if (!field) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
model.getGroup(group.name)[control.name] = field.value;
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
return model;
|
|
106
|
+
}
|
|
86
107
|
/**
|
|
87
108
|
* @param {VasFormModel} formModel
|
|
88
109
|
* @return {Record<string, VasFieldDtoValue>}
|
|
@@ -155,7 +176,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
155
176
|
.length;
|
|
156
177
|
// add total from files that are pending
|
|
157
178
|
pending += this.files
|
|
158
|
-
.filter(value => value.status !== '
|
|
179
|
+
.filter(value => value.status !== 'COMPLETE')
|
|
159
180
|
.length;
|
|
160
181
|
return {
|
|
161
182
|
pending,
|
|
@@ -163,18 +184,63 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
163
184
|
};
|
|
164
185
|
}
|
|
165
186
|
/**
|
|
166
|
-
* This method will
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
187
|
+
* This method will return the dynamic property from the JobModel that
|
|
188
|
+
* represent a group (from a form).
|
|
189
|
+
*
|
|
190
|
+
* @param name the name of the group
|
|
191
|
+
* @param init if true (default) and group is not found, initialise an empty
|
|
192
|
+
* group, otherwise throw an error
|
|
193
|
+
*/
|
|
194
|
+
getGroup(name, init = true) {
|
|
195
|
+
let prop;
|
|
196
|
+
if (this.staticProperties.includes(name)) {
|
|
197
|
+
throw Error(`invalid group name ${name}, not a dynamic property`);
|
|
198
|
+
}
|
|
199
|
+
else if (this.$this[name] === undefined) {
|
|
200
|
+
if (init) {
|
|
201
|
+
prop = this.$this[name] = {};
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
throw Error(`invalid group name ${name}, not found`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
prop = this.$this[name];
|
|
209
|
+
if (typeof prop !== 'object') {
|
|
210
|
+
throw Error(`invalid group name ${name}, not an object`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return prop;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @param path path segments
|
|
217
|
+
*/
|
|
218
|
+
getValueByPath(path = []) {
|
|
219
|
+
return (0, get_value_by_path_1.getValueByPath)(path, this.$this);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* In order to understand why we need this method it is important to
|
|
223
|
+
* understand that within the system, Jobs can be represented in one of two
|
|
224
|
+
* ways, document and relational.
|
|
225
|
+
*
|
|
226
|
+
* The important distinction is how values submitted by a form are stored.
|
|
227
|
+
*
|
|
228
|
+
* Jobs stored as documents (JSON objects) will store user values, as dynamic
|
|
229
|
+
* properties of the document.
|
|
230
|
+
*
|
|
231
|
+
* Whereas, Jobs stored as relational, will store user values in an array of
|
|
232
|
+
* {@link VasFieldDto} objects.
|
|
233
|
+
*
|
|
234
|
+
* Depending on where we are in the system, either one of these approaches can
|
|
235
|
+
* be more useful than the other.
|
|
236
|
+
*
|
|
237
|
+
* This method, assumes that the JobModel has been instantiated from a
|
|
238
|
+
* document representation, and serves to hydrate the fields array. In order
|
|
239
|
+
* to achieve this, knowledge of the {@link VasFormDto} that created the job
|
|
240
|
+
* is required.
|
|
241
|
+
*
|
|
242
|
+
*
|
|
243
|
+
* Job in document representation
|
|
178
244
|
* {
|
|
179
245
|
* id: <guid>,
|
|
180
246
|
* reference: "something"
|
|
@@ -184,7 +250,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
184
250
|
* }
|
|
185
251
|
* }
|
|
186
252
|
*
|
|
187
|
-
*
|
|
253
|
+
* Job in relational representation
|
|
188
254
|
* {
|
|
189
255
|
* id: <guid>,
|
|
190
256
|
* reference: "something"
|
|
@@ -199,46 +265,11 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
199
265
|
* ]
|
|
200
266
|
* }
|
|
201
267
|
*
|
|
202
|
-
* So, what this method does is given a JobModel in the form of A, read all
|
|
203
|
-
* of those dynamic properties and set them into `fields`. Doing this requires
|
|
204
|
-
* knowledge of the Form that was used to create the job. Moreover, since the
|
|
205
|
-
* dynamic properties do not contain the ids of the fields, we also allow to
|
|
206
|
-
* pass in a `controlFieldIdMap`. This map stores the mapping between Control
|
|
207
|
-
* and the Field that was created in the Job to store the value for that
|
|
208
|
-
* Control. This is useful, if for example you want to compare a Job in form A
|
|
209
|
-
* with a Job in form B, for example if you want to update the Job on the API
|
|
210
|
-
* with a Job that was saved by a client in form A.
|
|
211
|
-
*
|
|
212
|
-
* E.g.
|
|
213
|
-
* Client -> API: client requests form
|
|
214
|
-
* User -> Client: user fills in the form and submits
|
|
215
|
-
* Client -> Firestore: client saves the Job in form A i.e. dynamic props
|
|
216
|
-
* Firestore -> Function: A function is triggered to sync the job to the API
|
|
217
|
-
* Function -> API: Function checks if job already exists, it receives 404
|
|
218
|
-
* Function -> Function: The function calls `hydrateFields(...)`
|
|
219
|
-
* Function -> API: The function POST the Job to /jobs
|
|
220
|
-
* Function -> API: The function POST each field to /fields
|
|
221
|
-
*
|
|
222
|
-
* Similarly, if the user updates the job
|
|
223
|
-
* Client -> API: client requests form
|
|
224
|
-
* User -> Client: user fills in the form and submits an update
|
|
225
|
-
* Client -> Firestore: client saves the Job in form A i.e. dynamic props
|
|
226
|
-
* Firestore -> Function: A function is triggered to sync the job to the API
|
|
227
|
-
* Function -> API: Function checks if job already exists, it receives 200
|
|
228
|
-
* Function -> Function: The function calls `hydrateFields(...)` passing in
|
|
229
|
-
* the map is made by iterating over the fields it
|
|
230
|
-
* received from the API and storing the mappings
|
|
231
|
-
* between controlId and fieldId for each field
|
|
232
|
-
* Function -> API: The function PATCH the Job to /jobs
|
|
233
|
-
* Function -> API: The function POST/PATCH each field to /fields
|
|
234
|
-
* treated as new
|
|
235
268
|
*
|
|
236
|
-
* @param
|
|
237
|
-
* the
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* be generated, or to reuse an existing one from the map.
|
|
241
|
-
* @param {Array<string>} controlNames if a value is provided, it will be used
|
|
269
|
+
* @param formModel the VasFormModel that was used to create the job
|
|
270
|
+
* @param controlFieldIdMap This is used to determine the id each field.
|
|
271
|
+
* Either one will be found in the map, or a new one is generated.
|
|
272
|
+
* @param controlNames if a value is provided, it will be used
|
|
242
273
|
* to filter the fields that are returned.
|
|
243
274
|
* @return {Array<VasFieldDto>}
|
|
244
275
|
*/
|
|
@@ -270,13 +301,6 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
270
301
|
});
|
|
271
302
|
this.fields = fields;
|
|
272
303
|
}
|
|
273
|
-
/**
|
|
274
|
-
* @param {string[]} path path segments
|
|
275
|
-
* @return {void}
|
|
276
|
-
*/
|
|
277
|
-
getValueByPath(path = []) {
|
|
278
|
-
return (0, get_value_by_path_1.getValueByPath)(path, this.$this);
|
|
279
|
-
}
|
|
280
304
|
/**
|
|
281
305
|
* A very non sophisticated way to set values in the job via paths
|
|
282
306
|
*
|
|
@@ -291,8 +315,8 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
291
315
|
* }
|
|
292
316
|
* }
|
|
293
317
|
*
|
|
294
|
-
* @param
|
|
295
|
-
* @param
|
|
318
|
+
* @param value the value to set
|
|
319
|
+
* @param path path segments
|
|
296
320
|
*/
|
|
297
321
|
setValueByPath(value, path = []) {
|
|
298
322
|
switch (path.length) {
|
|
@@ -319,9 +343,8 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
319
343
|
}
|
|
320
344
|
}
|
|
321
345
|
/**
|
|
322
|
-
* @param
|
|
346
|
+
* @param staticOnly if true, will only output values for the static
|
|
323
347
|
* properties in the dto
|
|
324
|
-
* @return {VasJobDto}
|
|
325
348
|
*/
|
|
326
349
|
toDto(staticOnly = false) {
|
|
327
350
|
if (staticOnly) {
|
|
@@ -356,7 +379,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
356
379
|
}
|
|
357
380
|
const dto = {};
|
|
358
381
|
[...this.staticProperties, ...this.dynamicProperties]
|
|
359
|
-
.forEach(prop =>
|
|
382
|
+
.forEach(prop => dto[prop] = this.$this[prop]);
|
|
360
383
|
return dto;
|
|
361
384
|
}
|
|
362
385
|
/**
|
|
@@ -383,7 +406,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
383
406
|
*
|
|
384
407
|
* @param {string} value a string with the syntax
|
|
385
408
|
* @param {ParseSyntaxOptions} options
|
|
386
|
-
* @return
|
|
409
|
+
* @return the results of parsing the syntax on this job
|
|
387
410
|
*/
|
|
388
411
|
parseSyntax(value, options = {
|
|
389
412
|
timeZoneOffset: 0
|
|
@@ -417,7 +440,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
417
440
|
result = (this.getValueByPath(path) || '').toString();
|
|
418
441
|
}
|
|
419
442
|
else if (objectKey === 'fields') {
|
|
420
|
-
result = ((0, get_value_by_path_1.getValueByPath)(path, this.getFields2()) || '').toString();
|
|
443
|
+
result = ((0, get_value_by_path_1.getValueByPath)(['fields.' + path.shift(), ...path], this.getFields2()) || '').toString();
|
|
421
444
|
}
|
|
422
445
|
else if (objectKey.length) {
|
|
423
446
|
if (options.objects) {
|