@ironcode/vas-lib 3.0.0-alpha.2 → 3.0.0-alpha.3
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-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/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 +265 -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 +49 -60
- 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 +547 -55
- 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-field.dto.d.ts +3 -4
- 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,10 +1,12 @@
|
|
|
1
1
|
import { VasFileDto } from '../entity';
|
|
2
|
-
export interface
|
|
2
|
+
export interface VasCameraControlValueValue {
|
|
3
3
|
webPath: string;
|
|
4
4
|
path: string;
|
|
5
5
|
url?: string;
|
|
6
6
|
id?: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
/** @deprecated */
|
|
9
|
+
export type VasCameraControlValueModel = VasCameraControlValueValue;
|
|
10
|
+
export declare function isCameraControlValueV1(object: any): object is VasCameraControlValueValue;
|
|
9
11
|
export declare function isCameraControlValueV2(object: any): object is VasFileDto;
|
|
10
12
|
//# sourceMappingURL=vas-camera-control-value.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-camera-control-value.model.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/control-value/vas-camera-control-value.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,WAAW,0BAA0B;IAGzC,OAAO,EAAE,MAAM,CAAC;IAGhB,IAAI,EAAE,MAAM,CAAC;IAGb,GAAG,CAAC,EAAE,MAAM,CAAC;IAGb,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,GAAG,GACV,MAAM,IAAI,0BAA0B,CAMtC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,GAAG,GACV,MAAM,IAAI,UAAU,CAQtB"}
|
|
1
|
+
{"version":3,"file":"vas-camera-control-value.model.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/control-value/vas-camera-control-value.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,WAAW,0BAA0B;IAGzC,OAAO,EAAE,MAAM,CAAC;IAGhB,IAAI,EAAE,MAAM,CAAC;IAGb,GAAG,CAAC,EAAE,MAAM,CAAC;IAGb,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,kBAAkB;AAClB,MAAM,MAAM,0BAA0B,GAAG,0BAA0B,CAAC;AAEpE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,GAAG,GACV,MAAM,IAAI,0BAA0B,CAMtC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,GAAG,GACV,MAAM,IAAI,UAAU,CAQtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-camera-control-value.model.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/control-value/vas-camera-control-value.model.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"vas-camera-control-value.model.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/control-value/vas-camera-control-value.model.ts"],"names":[],"mappings":";;AAoBA,wDAQC;AAED,wDAUC;AApBD,SAAgB,sBAAsB,CACpC,MAAW;IAEX,OAAO,MAAM,YAAY,MAAM;WAC1B,SAAS,IAAI,MAAM;WACnB,MAAM,IAAI,MAAM;WAChB,KAAK,IAAI,MAAM;WACf,IAAI,IAAI,MAAM,CAAA;AACrB,CAAC;AAED,SAAgB,sBAAsB,CACpC,MAAW;IAEX,OAAO,MAAM,YAAY,MAAM;WAC1B,IAAI,IAAI,MAAM;WACd,MAAM,IAAI,MAAM;WAChB,UAAU,IAAI,MAAM;WACpB,UAAU,IAAI,MAAM;WACpB,UAAU,IAAI,MAAM;WACpB,QAAQ,IAAI,MAAM,CAAA;AACzB,CAAC","sourcesContent":["import { VasFileDto } from '../entity';\n\nexport interface VasCameraControlValueValue {\n // this is the object url which can be used as an img src.\n // **WARNING** only valid during the session when image was captured\n webPath: string;\n // path to the image on the device's storage.\n // **WARNING** only valid on the device that took the image\n path: string;\n // path to the image in cloud storage.\n // **WARNING** only valid once the image has been uploaded\n url?: string;\n // id we generated when uploading to Firebase Cloudstore\n // **WARNING** only valid once the image has been uploaded\n id?: string\n}\n\n/** @deprecated */\nexport type VasCameraControlValueModel = VasCameraControlValueValue;\n\nexport function isCameraControlValueV1(\n object: any\n): object is VasCameraControlValueValue {\n return object instanceof Object\n && 'webPath' in object\n && 'path' in object\n && 'url' in object\n && 'id' in object\n}\n\nexport function isCameraControlValueV2(\n object: any\n): object is VasFileDto {\n return object instanceof Object\n && 'id' in object\n && 'name' in object\n && 'fileSize' in object\n && 'mimeType' in object\n && 'sequence' in object\n && 'config' in object\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { VasJobDataDto } from './vas-job-data.dto';
|
|
2
2
|
import { VasFileDto } from './vas-file.dto';
|
|
3
|
-
import { GeoLocation } from '../model';
|
|
4
|
-
import { VasFunctionControlValueDto } from '../control-value';
|
|
5
|
-
|
|
6
|
-
export declare type FieldValueType = string | number | boolean | null | GeoLocation | Array<object | string | number | boolean | VasFileDto> | Record<string, any> | VasCameraControlValueModel | VasFunctionControlValueDto;
|
|
3
|
+
import { EstimateControlValueDto, GeoLocation } from '../model';
|
|
4
|
+
import { VasCameraControlValueValue, VasFunctionControlValueDto } from '../control-value';
|
|
5
|
+
export declare type FieldValueType = string | number | boolean | null | GeoLocation | Array<object | string | number | boolean | VasFileDto> | Record<string, any> | VasCameraControlValueValue | EstimateControlValueDto | VasFunctionControlValueDto;
|
|
7
6
|
export interface VasFieldDto extends VasJobDataDto {
|
|
8
7
|
control: string;
|
|
9
8
|
fieldJobPointers: Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-field.dto.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"vas-field.dto.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAE1F,MAAM,CAAC,OAAO,MAAM,cAAc,GAChC,MAAM,GACJ,MAAM,GACN,OAAO,GACP,IAAI,GACJ,WAAW,GACX,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,GACtD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACnB,0BAA0B,GAC1B,uBAAuB,GACvB,0BAA0B,CAC3B;AAEH,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-field.dto.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { VasJobDataDto } from './vas-job-data.dto';\nimport { VasFileDto } from './vas-file.dto';\nimport { GeoLocation } from '../model';\nimport { VasFunctionControlValueDto } from '../control-value';\
|
|
1
|
+
{"version":3,"file":"vas-field.dto.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { VasJobDataDto } from './vas-job-data.dto';\nimport { VasFileDto } from './vas-file.dto';\nimport { EstimateControlValueDto, GeoLocation } from '../model';\nimport { VasCameraControlValueValue, VasFunctionControlValueDto } from '../control-value';\n\nexport declare type FieldValueType =\n string\n | number\n | boolean\n | null\n | GeoLocation\n | Array<object | string | number | boolean | VasFileDto>\n | Record<string, any>\n | VasCameraControlValueValue\n | EstimateControlValueDto\n | VasFunctionControlValueDto\n ;\n\nexport interface VasFieldDto extends VasJobDataDto {\n control: string;\n fieldJobPointers: Array<string>;\n value: FieldValueType;\n version: number;\n controlName: string;\n controlTitle: string;\n controlTypeName: string;\n}\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"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EstimateControlValueModel = void 0;
|
|
4
|
+
const big_js_1 = require("big.js");
|
|
5
|
+
const b = (value = '0') => new big_js_1.Big(value);
|
|
6
|
+
/**
|
|
7
|
+
* Utility class for computing the summary value for an estimate control given
|
|
8
|
+
* the first and last estimates
|
|
9
|
+
*/
|
|
10
|
+
class EstimateControlValueModel {
|
|
11
|
+
static calculateSummary(original, latest) {
|
|
12
|
+
const o = original.summary;
|
|
13
|
+
const l = latest.adjusted ?
|
|
14
|
+
latest.summaryAdjusted :
|
|
15
|
+
latest.summary;
|
|
16
|
+
const s = {
|
|
17
|
+
labour: b(o.labour).minus(l.labour).toFixed(2),
|
|
18
|
+
none: b(o.none).minus(l.none).toFixed(2),
|
|
19
|
+
parts: b(o.parts).minus(l.parts).toFixed(2),
|
|
20
|
+
pm: b(o.pm).minus(l.pm).toFixed(2),
|
|
21
|
+
pl: b(o.pm).minus(l.pl).toFixed(2),
|
|
22
|
+
specialist: b(o.specialist).minus(l.specialist).toFixed(2),
|
|
23
|
+
other: b(o.other).minus(l.other).toFixed(2),
|
|
24
|
+
net: b(o.net).minus(l.net).toFixed(2),
|
|
25
|
+
vat: b(o.vat).minus(l.vat).toFixed(2),
|
|
26
|
+
gross: b(o.gross).minus(l.gross).toFixed(2),
|
|
27
|
+
hours: b(o.hours).minus(l.hours).toFixed(0),
|
|
28
|
+
labourRate: b(o.labourRate).minus(l.labourRate).toFixed(0)
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
original: o,
|
|
32
|
+
latest: l,
|
|
33
|
+
savings: s
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
static getEmptySummary() {
|
|
37
|
+
return {
|
|
38
|
+
original: {
|
|
39
|
+
labour: '0.00',
|
|
40
|
+
none: '0.00',
|
|
41
|
+
parts: '0.00',
|
|
42
|
+
pm: '0.00',
|
|
43
|
+
pl: '0.00',
|
|
44
|
+
specialist: '0.00',
|
|
45
|
+
other: '0.00',
|
|
46
|
+
net: '0.00',
|
|
47
|
+
vat: '0.00',
|
|
48
|
+
gross: '0.00',
|
|
49
|
+
hours: '0',
|
|
50
|
+
labourRate: '0.00'
|
|
51
|
+
},
|
|
52
|
+
latest: {
|
|
53
|
+
labour: '0.00',
|
|
54
|
+
none: '0.00',
|
|
55
|
+
parts: '0.00',
|
|
56
|
+
pm: '0.00',
|
|
57
|
+
pl: '0.00',
|
|
58
|
+
specialist: '0.00',
|
|
59
|
+
other: '0.00',
|
|
60
|
+
net: '0.00',
|
|
61
|
+
vat: '0.00',
|
|
62
|
+
gross: '0.00',
|
|
63
|
+
hours: '0',
|
|
64
|
+
labourRate: '0.00'
|
|
65
|
+
},
|
|
66
|
+
savings: {
|
|
67
|
+
labour: '0.00',
|
|
68
|
+
none: '0.00',
|
|
69
|
+
parts: '0.00',
|
|
70
|
+
pm: '0.00',
|
|
71
|
+
pl: '0.00',
|
|
72
|
+
specialist: '0.00',
|
|
73
|
+
other: '0.00',
|
|
74
|
+
net: '0.00',
|
|
75
|
+
vat: '0.00',
|
|
76
|
+
gross: '0.00',
|
|
77
|
+
hours: '0',
|
|
78
|
+
labourRate: '0.00'
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.EstimateControlValueModel = EstimateControlValueModel;
|
|
84
|
+
//# sourceMappingURL=estimate-control-value.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-control-value.model.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-control-value.model.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAKxC,MAAM,CAAC,GAAG,CAAC,QAAmB,GAAG,EAAE,EAAE,CAAC,IAAI,YAAG,CAAC,KAAK,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAa,yBAAyB;IAEpC,MAAM,CAAC,gBAAgB,CACrB,QAAuB,EACvB,MAAqB;QAGrB,MAAM,CAAC,GAAuB,QAAQ,CAAC,OAAO,CAAC;QAE/C,MAAM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BACP,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,MAAM;gBACb,EAAE,EAAE,MAAM;gBACV,EAAE,EAAE,MAAM;gBACV,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,MAAM;gBACb,GAAG,EAAE,MAAM;gBACX,GAAG,EAAE,MAAM;gBACX,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,GAAG;gBACV,UAAU,EAAE,MAAM;aACnB;SACF,CAAC;IACJ,CAAC;CACF;AAhFD,8DAgFC","sourcesContent":["import { Big, BigSource } from 'big.js';\nimport { EstimateControlValueSummaryDto } from './estimate-control-value.dto';\nimport { EstimateModel } from './estimate.model';\nimport { EstimateSummaryDto } from './estimate.dto';\n\nconst b = (value: BigSource = '0') => new Big(value);\n\n/**\n * Utility class for computing the summary value for an estimate control given\n * the first and last estimates\n */\nexport class EstimateControlValueModel {\n\n static calculateSummary(\n original: EstimateModel,\n latest: EstimateModel\n ): EstimateControlValueSummaryDto {\n\n const o: EstimateSummaryDto = original.summary;\n\n const l: EstimateSummaryDto = latest.adjusted ?\n latest.summaryAdjusted as EstimateSummaryDto :\n latest.summary;\n\n const s: EstimateControlValueSummaryDto['savings'] = {\n labour: b(o.labour).minus(l.labour).toFixed(2),\n none: b(o.none).minus(l.none).toFixed(2),\n parts: b(o.parts).minus(l.parts).toFixed(2),\n pm: b(o.pm).minus(l.pm).toFixed(2),\n pl: b(o.pm).minus(l.pl).toFixed(2),\n specialist: b(o.specialist).minus(l.specialist).toFixed(2),\n other: b(o.other).minus(l.other).toFixed(2),\n net: b(o.net).minus(l.net).toFixed(2),\n vat: b(o.vat).minus(l.vat).toFixed(2),\n gross: b(o.gross).minus(l.gross).toFixed(2),\n hours: b(o.hours).minus(l.hours).toFixed(0),\n labourRate: b(o.labourRate).minus(l.labourRate).toFixed(0)\n };\n return {\n original: o,\n latest: l,\n savings: s\n };\n }\n\n static getEmptySummary(): EstimateControlValueSummaryDto {\n return {\n original: {\n labour: '0.00',\n none: '0.00',\n parts: '0.00',\n pm: '0.00',\n pl: '0.00',\n specialist: '0.00',\n other: '0.00',\n net: '0.00',\n vat: '0.00',\n gross: '0.00',\n hours: '0',\n labourRate: '0.00'\n },\n latest: {\n labour: '0.00',\n none: '0.00',\n parts: '0.00',\n pm: '0.00',\n pl: '0.00',\n specialist: '0.00',\n other: '0.00',\n net: '0.00',\n vat: '0.00',\n gross: '0.00',\n hours: '0',\n labourRate: '0.00'\n },\n savings: {\n labour: '0.00',\n none: '0.00',\n parts: '0.00',\n pm: '0.00',\n pl: '0.00',\n specialist: '0.00',\n other: '0.00',\n net: '0.00',\n vat: '0.00',\n gross: '0.00',\n hours: '0',\n labourRate: '0.00'\n }\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EstimateCostCategory, EstimateWorkCategory } from './estimate.types';
|
|
2
|
+
export interface EstimateItemDto {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
type: string;
|
|
6
|
+
quantity: number;
|
|
7
|
+
units: number;
|
|
8
|
+
price: string;
|
|
9
|
+
workCategory: EstimateWorkCategory;
|
|
10
|
+
costCategory: EstimateCostCategory;
|
|
11
|
+
comment: string;
|
|
12
|
+
quantityAdjusted: number;
|
|
13
|
+
unitsAdjusted: number;
|
|
14
|
+
priceAdjusted: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=estimate-item.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-item.dto.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-item.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,oBAAoB,CAAC;IACnC,YAAY,EAAE,oBAAoB,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-item.dto.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-item.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateCostCategory, EstimateWorkCategory } from './estimate.types';\n\nexport interface EstimateItemDto {\n id: string;\n description: string;\n type: string;\n quantity: number;\n units: number;\n price: string;\n workCategory: EstimateWorkCategory;\n costCategory: EstimateCostCategory;\n comment: string;\n quantityAdjusted: number;\n unitsAdjusted: number;\n priceAdjusted: string;\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EstimateItemDto } from './estimate-item.dto';
|
|
2
|
+
import { EstimateCostCategory, EstimateWorkCategory } from './estimate.types';
|
|
3
|
+
export declare class EstimateItemModel {
|
|
4
|
+
id: string;
|
|
5
|
+
description: string;
|
|
6
|
+
type: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
quantityAdjusted: number;
|
|
9
|
+
units: number;
|
|
10
|
+
unitsAdjusted: number;
|
|
11
|
+
price: string;
|
|
12
|
+
priceAdjusted: string;
|
|
13
|
+
workCategory: EstimateWorkCategory;
|
|
14
|
+
costCategory: EstimateCostCategory;
|
|
15
|
+
comment: string;
|
|
16
|
+
constructor(id: string, description: string, type: string, quantity: number, quantityAdjusted: number, units: number, unitsAdjusted: number, price: string, priceAdjusted: string, workCategory: EstimateWorkCategory, costCategory: EstimateCostCategory, comment: string);
|
|
17
|
+
getTotalUnits(adjusted?: boolean): string;
|
|
18
|
+
getLineValue(labourRate?: string, timeBasis?: string, adjusted?: boolean): string;
|
|
19
|
+
toDto(): EstimateItemDto;
|
|
20
|
+
static create(): EstimateItemModel;
|
|
21
|
+
static fromDto(dto: Partial<EstimateItemDto>): EstimateItemModel;
|
|
22
|
+
static equal(a: EstimateItemDto | undefined, b: EstimateItemDto | undefined): boolean;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=estimate-item.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-item.model.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-item.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAe9E,qBAAa,iBAAiB;IAGnB,EAAE,EAAE,MAAM;IACV,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,gBAAgB,EAAE,MAAM;IACxB,KAAK,EAAE,MAAM;IACb,aAAa,EAAE,MAAM;IACrB,KAAK,EAAE,MAAM;IACb,aAAa,EAAE,MAAM;IACrB,YAAY,EAAE,oBAAoB;IAClC,YAAY,EAAE,oBAAoB;IAClC,OAAO,EAAE,MAAM;gBAXf,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,oBAAoB,EAClC,YAAY,EAAE,oBAAoB,EAClC,OAAO,EAAE,MAAM;IAIxB,aAAa,CAAC,QAAQ,UAAQ,GAAG,MAAM;IAMvC,YAAY,CACV,UAAU,SAAM,EAChB,SAAS,SAAM,EACf,QAAQ,UAAQ,GACf,MAAM;IA+CT,KAAK,IAAI,eAAe;IAiBxB,MAAM,CAAC,MAAM,IAAI,iBAAiB;IAiBlC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,iBAAiB;IAiBhE,MAAM,CAAC,KAAK,CACV,CAAC,EAAE,eAAe,GAAG,SAAS,EAC9B,CAAC,EAAE,eAAe,GAAG,SAAS,GAC7B,OAAO;CAiBX"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EstimateItemModel = void 0;
|
|
4
|
+
const big_js_1 = require("big.js");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
const b = (value = '0') => {
|
|
7
|
+
try {
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
return new big_js_1.Big(value.replace(/[^\d^.]/g, ''));
|
|
10
|
+
}
|
|
11
|
+
return new big_js_1.Big(value);
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
console.error(`failed to construct Big from value '${value}'`);
|
|
16
|
+
return new big_js_1.Big('0');
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
class EstimateItemModel {
|
|
20
|
+
constructor(id, description, type, quantity, quantityAdjusted, units, unitsAdjusted, price, priceAdjusted, workCategory, costCategory, comment) {
|
|
21
|
+
this.id = id;
|
|
22
|
+
this.description = description;
|
|
23
|
+
this.type = type;
|
|
24
|
+
this.quantity = quantity;
|
|
25
|
+
this.quantityAdjusted = quantityAdjusted;
|
|
26
|
+
this.units = units;
|
|
27
|
+
this.unitsAdjusted = unitsAdjusted;
|
|
28
|
+
this.price = price;
|
|
29
|
+
this.priceAdjusted = priceAdjusted;
|
|
30
|
+
this.workCategory = workCategory;
|
|
31
|
+
this.costCategory = costCategory;
|
|
32
|
+
this.comment = comment;
|
|
33
|
+
}
|
|
34
|
+
getTotalUnits(adjusted = false) {
|
|
35
|
+
return adjusted ?
|
|
36
|
+
b(this.quantityAdjusted || '0').mul(this.unitsAdjusted || '0').toFixed(2) :
|
|
37
|
+
b(this.quantity || '0').mul(this.units || '0').toFixed(2);
|
|
38
|
+
}
|
|
39
|
+
getLineValue(labourRate = '1', timeBasis = '1', adjusted = false) {
|
|
40
|
+
const cat = this.costCategory || 'none';
|
|
41
|
+
if (this.workCategory === 'removed') {
|
|
42
|
+
return '0';
|
|
43
|
+
}
|
|
44
|
+
const units = (adjusted ? this.unitsAdjusted : this.units) || 0;
|
|
45
|
+
const quantity = (adjusted ? this.quantityAdjusted : this.quantity) || 0;
|
|
46
|
+
const price = (adjusted ? this.priceAdjusted : this.price) || '';
|
|
47
|
+
try {
|
|
48
|
+
switch (cat) {
|
|
49
|
+
case 'labour': {
|
|
50
|
+
return price != '' ?
|
|
51
|
+
price :
|
|
52
|
+
b(quantity || '0')
|
|
53
|
+
.mul(units || '0')
|
|
54
|
+
.mul(labourRate || '0')
|
|
55
|
+
.div(timeBasis || '1')
|
|
56
|
+
.toFixed(2);
|
|
57
|
+
}
|
|
58
|
+
case 'pm': {
|
|
59
|
+
return b(price || '0')
|
|
60
|
+
.mul(quantity || '0')
|
|
61
|
+
.toFixed(2);
|
|
62
|
+
}
|
|
63
|
+
case 'parts': {
|
|
64
|
+
return b(price || '0')
|
|
65
|
+
.mul(quantity || '0')
|
|
66
|
+
.toFixed(2);
|
|
67
|
+
}
|
|
68
|
+
case 'specialist': {
|
|
69
|
+
return b(price || '0')
|
|
70
|
+
.mul(quantity || '0')
|
|
71
|
+
.toFixed(2);
|
|
72
|
+
}
|
|
73
|
+
default: {
|
|
74
|
+
return '0';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
console.warn(e);
|
|
80
|
+
}
|
|
81
|
+
return '0';
|
|
82
|
+
}
|
|
83
|
+
toDto() {
|
|
84
|
+
return {
|
|
85
|
+
id: this.id,
|
|
86
|
+
description: this.description,
|
|
87
|
+
type: this.type,
|
|
88
|
+
quantity: this.quantity,
|
|
89
|
+
quantityAdjusted: this.quantityAdjusted,
|
|
90
|
+
units: this.units,
|
|
91
|
+
unitsAdjusted: this.unitsAdjusted,
|
|
92
|
+
price: this.price,
|
|
93
|
+
priceAdjusted: this.priceAdjusted,
|
|
94
|
+
workCategory: this.workCategory,
|
|
95
|
+
costCategory: this.costCategory,
|
|
96
|
+
comment: this.comment
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static create() {
|
|
100
|
+
return new EstimateItemModel((0, uuid_1.v4)(), '', '', 1, 1, 0, 0, '', '', 'none', 'none', '');
|
|
101
|
+
}
|
|
102
|
+
static fromDto(dto) {
|
|
103
|
+
return new EstimateItemModel(dto.id || (0, uuid_1.v4)(), dto.description || '', dto.type || '', dto.quantity || 0, dto.quantityAdjusted || 0, dto.units || 0, dto.unitsAdjusted || 0, dto.price || '', dto.priceAdjusted || '', dto.workCategory || 'none', dto.costCategory || 'none', dto.comment || '');
|
|
104
|
+
}
|
|
105
|
+
static equal(a, b) {
|
|
106
|
+
return ((a === null || a === void 0 ? void 0 : a.id) === (b === null || b === void 0 ? void 0 : b.id) &&
|
|
107
|
+
(a === null || a === void 0 ? void 0 : a.description) === (b === null || b === void 0 ? void 0 : b.description) &&
|
|
108
|
+
(a === null || a === void 0 ? void 0 : a.type) === (b === null || b === void 0 ? void 0 : b.type) &&
|
|
109
|
+
(a === null || a === void 0 ? void 0 : a.quantity) === (b === null || b === void 0 ? void 0 : b.quantity) &&
|
|
110
|
+
(a === null || a === void 0 ? void 0 : a.quantityAdjusted) === (b === null || b === void 0 ? void 0 : b.quantityAdjusted) &&
|
|
111
|
+
(a === null || a === void 0 ? void 0 : a.units) === (b === null || b === void 0 ? void 0 : b.units) &&
|
|
112
|
+
(a === null || a === void 0 ? void 0 : a.unitsAdjusted) === (b === null || b === void 0 ? void 0 : b.unitsAdjusted) &&
|
|
113
|
+
(a === null || a === void 0 ? void 0 : a.price) === (b === null || b === void 0 ? void 0 : b.price) &&
|
|
114
|
+
(a === null || a === void 0 ? void 0 : a.priceAdjusted) === (b === null || b === void 0 ? void 0 : b.priceAdjusted) &&
|
|
115
|
+
(a === null || a === void 0 ? void 0 : a.workCategory) === (b === null || b === void 0 ? void 0 : b.workCategory) &&
|
|
116
|
+
(a === null || a === void 0 ? void 0 : a.costCategory) === (b === null || b === void 0 ? void 0 : b.costCategory) &&
|
|
117
|
+
(a === null || a === void 0 ? void 0 : a.comment) === (b === null || b === void 0 ? void 0 : b.comment));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.EstimateItemModel = EstimateItemModel;
|
|
121
|
+
//# sourceMappingURL=estimate-item.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate-item.model.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate-item.model.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;AAE7B,+BAAkC;AAGlC,MAAM,CAAC,GAAG,CAAC,QAA+B,GAAG,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,YAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,YAAG,CAAC,KAAK,CAAC,CAAC;QACtB,6DAA6D;IAC/D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,uCAAuC,KAAK,GAAG,CAAC,CAAC;QAC/D,OAAO,IAAI,YAAG,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AAEF,MAAa,iBAAiB;IAE5B,YACS,EAAU,EACV,WAAmB,EACnB,IAAY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D,CAAC,uBAAD,CAAC,CAAE,aAAa,CAAA;YACrC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,CAAA;YACnC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,YAAY,CAAA;YACnC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,OAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAA,CAC1B,CAAC;IACJ,CAAC;CAEF;AAlJD,8CAkJC","sourcesContent":["import { Big } from 'big.js';\nimport { EstimateItemDto } from './estimate-item.dto';\nimport { v4 as uuid } from 'uuid';\nimport { EstimateCostCategory, EstimateWorkCategory } from './estimate.types';\n\nconst b = (value: string | number | Big = '0') => {\n try {\n if (typeof value === 'string') {\n return new Big(value.replace(/[^\\d^.]/g, ''));\n }\n return new Big(value);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n console.error(`failed to construct Big from value '${value}'`);\n return new Big('0');\n }\n};\n\nexport class EstimateItemModel {\n\n constructor(\n public id: string,\n public description: string,\n public type: string,\n public quantity: number,\n public quantityAdjusted: number,\n public units: number,\n public unitsAdjusted: number,\n public price: string,\n public priceAdjusted: string,\n public workCategory: EstimateWorkCategory,\n public costCategory: EstimateCostCategory,\n public comment: string\n ) {\n }\n\n getTotalUnits(adjusted = false): string {\n return adjusted ?\n b(this.quantityAdjusted || '0').mul(this.unitsAdjusted || '0').toFixed(2) :\n b(this.quantity || '0').mul(this.units || '0').toFixed(2);\n }\n\n getLineValue(\n labourRate = '1',\n timeBasis = '1',\n adjusted = false\n ): string {\n const cat: EstimateCostCategory = this.costCategory || 'none';\n\n if (this.workCategory === 'removed') {\n return '0';\n }\n\n const units = (adjusted ? this.unitsAdjusted : this.units) || 0;\n const quantity = (adjusted ? this.quantityAdjusted : this.quantity) || 0;\n const price = (adjusted ? this.priceAdjusted : this.price) || '';\n\n try {\n switch (cat) {\n case 'labour': {\n return price != '' ?\n price :\n b(quantity || '0')\n .mul(units || '0')\n .mul(labourRate || '0')\n .div(timeBasis || '1')\n .toFixed(2);\n }\n case 'pm': {\n return b(price || '0')\n .mul(quantity || '0')\n .toFixed(2);\n }\n case 'parts': {\n return b(price || '0')\n .mul(quantity || '0')\n .toFixed(2);\n }\n case 'specialist': {\n return b(price || '0')\n .mul(quantity || '0')\n .toFixed(2);\n }\n default: {\n return '0';\n }\n }\n } catch (e) {\n console.warn(e);\n }\n return '0';\n }\n\n toDto(): EstimateItemDto {\n return {\n id: this.id,\n description: this.description,\n type: this.type,\n quantity: this.quantity,\n quantityAdjusted: this.quantityAdjusted,\n units: this.units,\n unitsAdjusted: this.unitsAdjusted,\n price: this.price,\n priceAdjusted: this.priceAdjusted,\n workCategory: this.workCategory,\n costCategory: this.costCategory,\n comment: this.comment\n };\n }\n\n static create(): EstimateItemModel {\n return new EstimateItemModel(\n uuid(),\n '',\n '',\n 1,\n 1,\n 0,\n 0,\n '',\n '',\n 'none',\n 'none',\n ''\n );\n }\n\n static fromDto(dto: Partial<EstimateItemDto>): EstimateItemModel {\n return new EstimateItemModel(\n dto.id || uuid(),\n dto.description || '',\n dto.type || '',\n dto.quantity || 0,\n dto.quantityAdjusted || 0,\n dto.units || 0,\n dto.unitsAdjusted || 0,\n dto.price || '',\n dto.priceAdjusted || '',\n dto.workCategory || 'none',\n dto.costCategory || 'none',\n dto.comment || ''\n );\n }\n\n static equal(\n a: EstimateItemDto | undefined,\n b: EstimateItemDto | undefined\n ): boolean {\n return (\n a?.id === b?.id &&\n a?.description === b?.description &&\n a?.type === b?.type &&\n a?.quantity === b?.quantity &&\n a?.quantityAdjusted === b?.quantityAdjusted &&\n a?.units === b?.units &&\n a?.unitsAdjusted === b?.unitsAdjusted &&\n a?.price === b?.price &&\n a?.priceAdjusted === b?.priceAdjusted &&\n a?.workCategory === b?.workCategory &&\n a?.costCategory === b?.costCategory &&\n a?.comment === b?.comment\n );\n }\n\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EstimateItemDto } from './estimate-item.dto';
|
|
2
|
+
import { EstimateSource, EstimateSundryMethod } from './estimate.model';
|
|
3
|
+
import { EstimateCostCategory } from './estimate.types';
|
|
4
|
+
export type CostCategorySummary = Record<EstimateCostCategory, string>;
|
|
5
|
+
export interface CostCategorySummaryTotals {
|
|
6
|
+
net: string;
|
|
7
|
+
vat: string;
|
|
8
|
+
gross: string;
|
|
9
|
+
hours: string;
|
|
10
|
+
labourRate: string;
|
|
11
|
+
}
|
|
12
|
+
export type EstimateSummaryDto = CostCategorySummary & CostCategorySummaryTotals;
|
|
13
|
+
export interface EstimateDto {
|
|
14
|
+
id: string;
|
|
15
|
+
source: EstimateSource;
|
|
16
|
+
label: string;
|
|
17
|
+
comment: string;
|
|
18
|
+
timestamp: string;
|
|
19
|
+
version: number;
|
|
20
|
+
net: string;
|
|
21
|
+
vat: string;
|
|
22
|
+
gross: string;
|
|
23
|
+
labourRate: string;
|
|
24
|
+
vatRate: string;
|
|
25
|
+
sundryRate: string;
|
|
26
|
+
sundryMax: string;
|
|
27
|
+
sundryFixed: string;
|
|
28
|
+
sundryMethod: EstimateSundryMethod;
|
|
29
|
+
partsDiscount: string;
|
|
30
|
+
paintDiscount: string;
|
|
31
|
+
timeBasis: string;
|
|
32
|
+
adjusted: boolean;
|
|
33
|
+
items: Array<EstimateItemDto>;
|
|
34
|
+
summary: EstimateSummaryDto;
|
|
35
|
+
summaryAdjusted: EstimateSummaryDto | null;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=estimate.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.dto.d.ts","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eA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
|
+
{"version":3,"file":"estimate.dto.js","sourceRoot":"","sources":["../../../../../../projects/vas-lib/src/lib/model/estimate-control/estimate.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateItemDto } from './estimate-item.dto';\nimport { EstimateSource, EstimateSundryMethod } from './estimate.model';\nimport { EstimateCostCategory } from './estimate.types';\n\nexport type CostCategorySummary = Record<EstimateCostCategory, string>;\n\nexport interface CostCategorySummaryTotals {\n net: string;\n vat: string;\n gross: string;\n hours: string;\n labourRate: string;\n}\n\nexport type EstimateSummaryDto = CostCategorySummary & CostCategorySummaryTotals;\n\nexport interface EstimateDto {\n id: string;\n source: EstimateSource;\n label: string;\n comment: string;\n timestamp: string;\n version: number;\n net: string;\n vat: string;\n gross: string;\n labourRate: string;\n vatRate: string;\n sundryRate: string;\n sundryMax: string;\n sundryFixed: string;\n sundryMethod: EstimateSundryMethod;\n partsDiscount: string;\n paintDiscount: string;\n timeBasis: string;\n adjusted: boolean;\n items: Array<EstimateItemDto>;\n summary: EstimateSummaryDto;\n summaryAdjusted: EstimateSummaryDto | null;\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EstimateItemModel } from './estimate-item.model';
|
|
2
|
+
import { EstimateDto, EstimateSummaryDto } from './estimate.dto';
|
|
3
|
+
import { EstimateItemDto } from './estimate-item.dto';
|
|
4
|
+
export declare type EstimateSundryMethod = 'percentage' | 'percentage-with-max' | 'fixed';
|
|
5
|
+
export declare type EstimateSource = 'audatex' | 'glassmatix' | 'manual' | 'ibody';
|
|
6
|
+
export declare class EstimateModel {
|
|
7
|
+
id: string;
|
|
8
|
+
source: EstimateSource;
|
|
9
|
+
label: string;
|
|
10
|
+
comment: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
version: number;
|
|
13
|
+
net: string;
|
|
14
|
+
vat: string;
|
|
15
|
+
gross: string;
|
|
16
|
+
labourRate: string;
|
|
17
|
+
vatRate: string;
|
|
18
|
+
sundryRate: string;
|
|
19
|
+
sundryMax: string;
|
|
20
|
+
sundryFixed: string;
|
|
21
|
+
sundryMethod: EstimateSundryMethod;
|
|
22
|
+
partsDiscount: string;
|
|
23
|
+
paintDiscount: string;
|
|
24
|
+
timeBasis: string;
|
|
25
|
+
adjusted: boolean;
|
|
26
|
+
items: Array<EstimateItemModel>;
|
|
27
|
+
summaryNet: EstimateSummaryDto;
|
|
28
|
+
summary: EstimateSummaryDto;
|
|
29
|
+
summaryAdjusted: EstimateSummaryDto;
|
|
30
|
+
static create(source?: EstimateSource): EstimateModel;
|
|
31
|
+
static fromDto(dto: Partial<EstimateDto>): EstimateModel;
|
|
32
|
+
addItem(modelOrDto: EstimateItemModel | Partial<EstimateItemDto>, opts?: {
|
|
33
|
+
calculate?: boolean;
|
|
34
|
+
}): void;
|
|
35
|
+
addItems(items: Array<EstimateItemModel>, opts?: {
|
|
36
|
+
calculate?: boolean;
|
|
37
|
+
}): void;
|
|
38
|
+
calculate(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the net summary (before sundries and discounts) of the estimate.
|
|
41
|
+
* By summary, we mean grouping the costs by cost category.
|
|
42
|
+
*
|
|
43
|
+
* @param adjusted if the values should be calculated using the original or
|
|
44
|
+
* adjusted values
|
|
45
|
+
*/
|
|
46
|
+
getSummaryNet(adjusted?: boolean): EstimateSummaryDto;
|
|
47
|
+
/**
|
|
48
|
+
* Applies the sundry and discount values to the net summary.
|
|
49
|
+
|
|
50
|
+
*/
|
|
51
|
+
getSummary(summaryNet: EstimateDto['summary'], sundryRate: string, sundryMax: string, sundryFixed: string, sundryMethod: EstimateSundryMethod, partsDiscount: string, paintDiscount: string, adjusted: boolean): EstimateDto['summary'];
|
|
52
|
+
toDto(): EstimateDto;
|
|
53
|
+
getTotalHours(adjusted?: boolean): string;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=estimate.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimate.model.d.ts","sourceRoot":"","sources":["../../../../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