taxtank-core 0.1.4 → 0.2.2
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/bundles/taxtank-core.umd.js +398 -293
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/abstract.collection.js +19 -3
- package/esm2015/lib/collections/collection-dictionary.js +4 -1
- package/esm2015/lib/collections/user-event-setting.collection.js +3 -55
- package/esm2015/lib/db/Enums/user-event-status.enum.js +2 -1
- package/esm2015/lib/db/Enums/user-event-type-client-type.enum.js +29 -0
- package/esm2015/lib/db/Enums/user-event-type-employee-type.enum.js +17 -0
- package/esm2015/lib/db/Enums/user-event-type-frequency.enum.js +4 -5
- package/esm2015/lib/db/Enums/user-event-type-user-type.enum.js +7 -0
- package/esm2015/lib/db/Models/user-event-setting.js +1 -1
- package/esm2015/lib/db/Models/user-event-type-category.js +3 -0
- package/esm2015/lib/db/Models/user-event-type.js +1 -1
- package/esm2015/lib/db/Models/user-event.js +1 -1
- package/esm2015/lib/models/bank/bank-connection.js +8 -1
- package/esm2015/lib/models/bank/bank.js +4 -14
- package/esm2015/lib/models/data-table/data-table-column.js +13 -0
- package/esm2015/lib/models/data-table/data-table.js +40 -0
- package/esm2015/lib/models/endpoint/endpoints.const.js +3 -1
- package/esm2015/lib/models/notification/notification.js +13 -37
- package/esm2015/lib/models/pdf/pdf-config.js +24 -0
- package/esm2015/lib/models/user-event/user-event-setting.js +3 -3
- package/esm2015/lib/models/user-event/user-event-type-category.js +4 -0
- package/esm2015/lib/models/user-event/user-event-type.js +13 -18
- package/esm2015/lib/services/bank/bank-account.service.js +9 -5
- package/esm2015/lib/services/bank/bank-connection.service.js +10 -1
- package/esm2015/lib/services/bank/bank-transaction.service.js +3 -3
- package/esm2015/lib/services/bank/basiq.service.js +3 -3
- package/esm2015/lib/services/firm/firm.service.js +2 -2
- package/esm2015/lib/services/pdf/pdf.service.js +55 -0
- package/esm2015/lib/services/xlsx/xlsx.service.js +54 -0
- package/esm2015/lib/tt-core.module.js +2 -1
- package/esm2015/public-api.js +9 -7
- package/fesm2015/taxtank-core.js +351 -264
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/abstract.collection.d.ts +4 -1
- package/lib/collections/collection-dictionary.d.ts +4 -1
- package/lib/collections/user-event-setting.collection.d.ts +1 -23
- package/lib/db/Enums/user-event-status.enum.d.ts +2 -1
- package/lib/db/Enums/user-event-type-client-type.enum.d.ts +27 -0
- package/lib/db/Enums/user-event-type-employee-type.enum.d.ts +15 -0
- package/lib/db/Enums/user-event-type-frequency.enum.d.ts +3 -4
- package/lib/db/Enums/user-event-type-user-type.enum.d.ts +5 -0
- package/lib/db/Models/user-event-setting.d.ts +1 -1
- package/lib/db/Models/user-event-type-category.d.ts +4 -0
- package/lib/db/Models/user-event-type.d.ts +5 -3
- package/lib/db/Models/user-event.d.ts +3 -1
- package/lib/models/bank/bank-connection.d.ts +4 -0
- package/lib/models/bank/bank.d.ts +0 -2
- package/lib/models/data-table/data-table-column.d.ts +20 -0
- package/lib/models/data-table/data-table.d.ts +24 -0
- package/lib/models/notification/notification.d.ts +4 -6
- package/lib/models/pdf/pdf-config.d.ts +8 -0
- package/lib/models/user-event/user-event-setting.d.ts +1 -1
- package/lib/models/user-event/user-event-type-category.d.ts +3 -0
- package/lib/models/user-event/user-event-type.d.ts +4 -2
- package/lib/services/bank/bank-account.service.d.ts +2 -2
- package/lib/services/bank/bank-connection.service.d.ts +2 -0
- package/lib/services/firm/firm.service.d.ts +1 -1
- package/lib/services/pdf/pdf.service.d.ts +14 -0
- package/lib/services/xlsx/xlsx.service.d.ts +11 -0
- package/package.json +6 -2
- package/public-api.d.ts +8 -6
- package/esm2015/lib/db/Enums/user-event-type-reminder-type.enum.js +0 -8
- package/esm2015/lib/db/Enums/user-event-type-reminder.enum.js +0 -7
- package/esm2015/lib/db/Enums/user-event-type-type.enum.js +0 -35
- package/esm2015/lib/models/notification/notification-event-types.const.js +0 -43
- package/esm2015/lib/models/user-event/user-event-category.enum.js +0 -11
- package/esm2015/lib/models/user-event/user-event-category.js +0 -6
- package/lib/db/Enums/user-event-type-reminder-type.enum.d.ts +0 -6
- package/lib/db/Enums/user-event-type-reminder.enum.d.ts +0 -5
- package/lib/db/Enums/user-event-type-type.enum.d.ts +0 -33
- package/lib/models/notification/notification-event-types.const.d.ts +0 -7
- package/lib/models/user-event/user-event-category.d.ts +0 -8
- package/lib/models/user-event/user-event-category.enum.d.ts +0 -9
package/fesm2015/taxtank-core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule,
|
|
2
|
+
import { NgModule, Injectable, Inject, EventEmitter } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import has from 'lodash/has';
|
|
5
5
|
import get from 'lodash/get';
|
|
@@ -9,8 +9,8 @@ import last from 'lodash/last';
|
|
|
9
9
|
import uniqBy from 'lodash/uniqBy';
|
|
10
10
|
import concat from 'lodash/concat';
|
|
11
11
|
import compact from 'lodash/compact';
|
|
12
|
-
import { __decorate,
|
|
13
|
-
import { Type, plainToClass,
|
|
12
|
+
import { __decorate, __awaiter } from 'tslib';
|
|
13
|
+
import { Type, plainToClass, Exclude, Transform, Expose, classToPlain } from 'class-transformer';
|
|
14
14
|
import * as moment from 'moment';
|
|
15
15
|
import { DateRange } from 'moment-range';
|
|
16
16
|
import cloneDeep$1 from 'lodash/cloneDeep';
|
|
@@ -24,10 +24,15 @@ import { EventSourcePolyfill } from 'event-source-polyfill/src/eventsource.min.j
|
|
|
24
24
|
import * as i1$1 from '@angular/router';
|
|
25
25
|
import { NavigationEnd } from '@angular/router';
|
|
26
26
|
import clone from 'lodash/clone';
|
|
27
|
+
import jsPDF from 'jspdf';
|
|
28
|
+
import autoTable from 'jspdf-autotable';
|
|
27
29
|
import { loadStripe } from '@stripe/stripe-js';
|
|
30
|
+
import * as xlsx from 'xlsx';
|
|
31
|
+
import * as FileSaver from 'file-saver';
|
|
28
32
|
|
|
29
33
|
class TtCoreModule {
|
|
30
34
|
static forRoot(environment) {
|
|
35
|
+
localStorage.setItem('api_uri', environment['api_uri']);
|
|
31
36
|
return {
|
|
32
37
|
ngModule: TtCoreModule,
|
|
33
38
|
providers: [
|
|
@@ -109,6 +114,9 @@ class CollectionDictionary {
|
|
|
109
114
|
createCollection(items = []) {
|
|
110
115
|
return new this.collectionConstructor(items);
|
|
111
116
|
}
|
|
117
|
+
length() {
|
|
118
|
+
return this.keys.length;
|
|
119
|
+
}
|
|
112
120
|
/**
|
|
113
121
|
* Group collection items by passed path into items object
|
|
114
122
|
*/
|
|
@@ -134,6 +142,7 @@ class CollectionDictionary {
|
|
|
134
142
|
}
|
|
135
143
|
}
|
|
136
144
|
|
|
145
|
+
const DEFAULT_INDEX = 'other';
|
|
137
146
|
/**
|
|
138
147
|
* collection abstract class. Contains common properties and methods for all collections
|
|
139
148
|
*/
|
|
@@ -141,8 +150,22 @@ class AbstractCollection {
|
|
|
141
150
|
constructor(items = []) {
|
|
142
151
|
this.items = items;
|
|
143
152
|
}
|
|
144
|
-
|
|
145
|
-
return new
|
|
153
|
+
create(items = []) {
|
|
154
|
+
return new this.constructor(items);
|
|
155
|
+
}
|
|
156
|
+
getBy(field, value) {
|
|
157
|
+
return this.create(this.items.filter((item) => item[field] === value));
|
|
158
|
+
}
|
|
159
|
+
groupBy(path = '') {
|
|
160
|
+
return new CollectionDictionary(this, path);
|
|
161
|
+
}
|
|
162
|
+
indexBy(path) {
|
|
163
|
+
// Create empty initial object for groups
|
|
164
|
+
const result = {};
|
|
165
|
+
this.toArray().forEach((model) => {
|
|
166
|
+
result[get(model, path, DEFAULT_INDEX)] = model;
|
|
167
|
+
});
|
|
168
|
+
return result;
|
|
146
169
|
}
|
|
147
170
|
/**
|
|
148
171
|
* Iterator that allow to iterate collection items
|
|
@@ -1347,117 +1370,12 @@ class TransactionCollection extends AbstractCollection {
|
|
|
1347
1370
|
}
|
|
1348
1371
|
}
|
|
1349
1372
|
|
|
1350
|
-
class UserEventSetting$1 {
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
class UserEventType$1 {
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
/**
|
|
1357
|
-
* Category of user event type
|
|
1358
|
-
*/
|
|
1359
|
-
class UserEventCategory {
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* Enum with user event categories
|
|
1364
|
-
*/
|
|
1365
|
-
var UserEventCategoryEnum;
|
|
1366
|
-
(function (UserEventCategoryEnum) {
|
|
1367
|
-
UserEventCategoryEnum[UserEventCategoryEnum["USER"] = 1] = "USER";
|
|
1368
|
-
UserEventCategoryEnum[UserEventCategoryEnum["CO_OWNER"] = 2] = "CO_OWNER";
|
|
1369
|
-
UserEventCategoryEnum[UserEventCategoryEnum["FIRM"] = 3] = "FIRM";
|
|
1370
|
-
UserEventCategoryEnum[UserEventCategoryEnum["BASIQ"] = 4] = "BASIQ";
|
|
1371
|
-
})(UserEventCategoryEnum || (UserEventCategoryEnum = {}));
|
|
1372
|
-
|
|
1373
|
-
class UserEventType extends UserEventType$1 {
|
|
1374
|
-
}
|
|
1375
|
-
__decorate([
|
|
1376
|
-
Expose({ toClassOnly: true }),
|
|
1377
|
-
Transform(({ obj }) => {
|
|
1378
|
-
switch (true) {
|
|
1379
|
-
case String(obj.type).startsWith('1'):
|
|
1380
|
-
return plainToClass(UserEventCategory, { name: 'User\'s events', type: UserEventCategoryEnum.USER });
|
|
1381
|
-
case String(obj.type).startsWith('2'):
|
|
1382
|
-
return plainToClass(UserEventCategory, { name: 'Co-owner\'s events', type: UserEventCategoryEnum.CO_OWNER });
|
|
1383
|
-
case String(obj.type).startsWith('3'):
|
|
1384
|
-
return plainToClass(UserEventCategory, { name: 'Firm\'s events', type: UserEventCategoryEnum.FIRM });
|
|
1385
|
-
default:
|
|
1386
|
-
return plainToClass(UserEventCategory, { name: 'Basiq events', type: UserEventCategoryEnum.BASIQ });
|
|
1387
|
-
}
|
|
1388
|
-
}),
|
|
1389
|
-
Type(() => UserEventCategory)
|
|
1390
|
-
], UserEventType.prototype, "category", void 0);
|
|
1391
|
-
|
|
1392
|
-
class UserEventSetting extends UserEventSetting$1 {
|
|
1393
|
-
constructor() {
|
|
1394
|
-
super(...arguments);
|
|
1395
|
-
// flag indicates that the setting is updating now saved or not
|
|
1396
|
-
this.isUpdating = false;
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
__decorate([
|
|
1400
|
-
Type(() => UserEventType)
|
|
1401
|
-
], UserEventSetting.prototype, "userEventType", void 0);
|
|
1402
|
-
__decorate([
|
|
1403
|
-
Exclude({ toPlainOnly: true })
|
|
1404
|
-
], UserEventSetting.prototype, "isUpdating", void 0);
|
|
1405
|
-
|
|
1406
1373
|
/**
|
|
1407
1374
|
* Collection of user event settings
|
|
1408
1375
|
*/
|
|
1409
1376
|
class UserEventSettingCollection extends AbstractCollection {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
this.setItems(userEventTypes);
|
|
1413
|
-
}
|
|
1414
|
-
/**
|
|
1415
|
-
* Flag that indicates if all settings are selected for provided field
|
|
1416
|
-
*/
|
|
1417
|
-
isAllSelected(field) {
|
|
1418
|
-
return !this.items.find((item) => !item[field]);
|
|
1419
|
-
}
|
|
1420
|
-
/**
|
|
1421
|
-
* Flag that indicates if all settings are deselected for provided field
|
|
1422
|
-
*/
|
|
1423
|
-
isAllDeselected(field) {
|
|
1424
|
-
return !this.items.find((item) => item[field]);
|
|
1425
|
-
}
|
|
1426
|
-
/**
|
|
1427
|
-
* Check is any setting is updating by 'isUpdating' flag
|
|
1428
|
-
*/
|
|
1429
|
-
isAnyUpdating() {
|
|
1430
|
-
return this.items.some((item) => item.isUpdating);
|
|
1431
|
-
}
|
|
1432
|
-
/**
|
|
1433
|
-
* Get frequency type based on each collection item 'frequency' field value
|
|
1434
|
-
*/
|
|
1435
|
-
get commonFrequencyType() {
|
|
1436
|
-
const frequencyDictionary = new CollectionDictionary(this, '', 'frequency');
|
|
1437
|
-
return +Object.keys(frequencyDictionary).find((key) => frequencyDictionary[key].length === this.length) || false;
|
|
1438
|
-
}
|
|
1439
|
-
/**
|
|
1440
|
-
* Rewrite collection items with provided user event types
|
|
1441
|
-
*/
|
|
1442
|
-
setItems(userEventTypes) {
|
|
1443
|
-
if (!userEventTypes) {
|
|
1444
|
-
return;
|
|
1445
|
-
}
|
|
1446
|
-
this.items = userEventTypes.map((userEventType) => {
|
|
1447
|
-
// find existing setting by user event type id
|
|
1448
|
-
const existingSetting = this.items.find((setting) => setting.userEventType.id === userEventType.id);
|
|
1449
|
-
// if setting exist - return new UserEventSetting instance based on existing setting and default user event type
|
|
1450
|
-
if (existingSetting) {
|
|
1451
|
-
return plainToClass(UserEventSetting, Object.assign(existingSetting, { userEventType }));
|
|
1452
|
-
}
|
|
1453
|
-
// ...or return new UserEventSetting instance based on default user event type
|
|
1454
|
-
return plainToClass(UserEventSetting, {
|
|
1455
|
-
byEmail: userEventType.byEmail,
|
|
1456
|
-
byNotification: userEventType.byNotification,
|
|
1457
|
-
frequency: userEventType.frequency,
|
|
1458
|
-
userEventType
|
|
1459
|
-
});
|
|
1460
|
-
});
|
|
1377
|
+
getConfigurableBy(field) {
|
|
1378
|
+
return new UserEventSettingCollection(this.items.filter((setting) => setting[field] !== null));
|
|
1461
1379
|
}
|
|
1462
1380
|
}
|
|
1463
1381
|
|
|
@@ -2057,65 +1975,68 @@ var UserEventStatusEnum;
|
|
|
2057
1975
|
UserEventStatusEnum[UserEventStatusEnum["NEED_ACTION"] = 2] = "NEED_ACTION";
|
|
2058
1976
|
UserEventStatusEnum[UserEventStatusEnum["DONE"] = 3] = "DONE";
|
|
2059
1977
|
UserEventStatusEnum[UserEventStatusEnum["REFUSED"] = 4] = "REFUSED";
|
|
1978
|
+
UserEventStatusEnum[UserEventStatusEnum["OUTDATED"] = 5] = "OUTDATED";
|
|
2060
1979
|
})(UserEventStatusEnum || (UserEventStatusEnum = {}));
|
|
2061
1980
|
|
|
2062
1981
|
var UserEventTypeFrequencyEnum;
|
|
2063
1982
|
(function (UserEventTypeFrequencyEnum) {
|
|
2064
|
-
UserEventTypeFrequencyEnum[UserEventTypeFrequencyEnum["
|
|
2065
|
-
UserEventTypeFrequencyEnum[UserEventTypeFrequencyEnum["
|
|
2066
|
-
UserEventTypeFrequencyEnum[UserEventTypeFrequencyEnum["
|
|
2067
|
-
UserEventTypeFrequencyEnum[UserEventTypeFrequencyEnum["MONTHLY"] = 4] = "MONTHLY";
|
|
1983
|
+
UserEventTypeFrequencyEnum[UserEventTypeFrequencyEnum["DAILY"] = 1] = "DAILY";
|
|
1984
|
+
UserEventTypeFrequencyEnum[UserEventTypeFrequencyEnum["WEEKLY"] = 2] = "WEEKLY";
|
|
1985
|
+
UserEventTypeFrequencyEnum[UserEventTypeFrequencyEnum["MONTHLY"] = 3] = "MONTHLY";
|
|
2068
1986
|
})(UserEventTypeFrequencyEnum || (UserEventTypeFrequencyEnum = {}));
|
|
2069
1987
|
|
|
2070
|
-
var
|
|
2071
|
-
(function (
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
})(
|
|
2076
|
-
|
|
2077
|
-
var
|
|
2078
|
-
(function (
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
1988
|
+
var UserEventTypeUserTypeEnum;
|
|
1989
|
+
(function (UserEventTypeUserTypeEnum) {
|
|
1990
|
+
UserEventTypeUserTypeEnum[UserEventTypeUserTypeEnum["REGISTERED"] = 1000] = "REGISTERED";
|
|
1991
|
+
UserEventTypeUserTypeEnum[UserEventTypeUserTypeEnum["PASSWORD_RESET"] = 1001] = "PASSWORD_RESET";
|
|
1992
|
+
UserEventTypeUserTypeEnum[UserEventTypeUserTypeEnum["APP_FEATURES"] = 1010] = "APP_FEATURES";
|
|
1993
|
+
})(UserEventTypeUserTypeEnum || (UserEventTypeUserTypeEnum = {}));
|
|
1994
|
+
|
|
1995
|
+
var UserEventTypeEmployeeTypeEnum;
|
|
1996
|
+
(function (UserEventTypeEmployeeTypeEnum) {
|
|
1997
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["FIRM_INVITE_TO_REGISTER"] = 3000] = "FIRM_INVITE_TO_REGISTER";
|
|
1998
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["FIRM_INVITE"] = 3001] = "FIRM_INVITE";
|
|
1999
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["CLIENT_INVITE_ACCEPTED"] = 3002] = "CLIENT_INVITE_ACCEPTED";
|
|
2000
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["CLIENT_INVITE_REJECTED"] = 3003] = "CLIENT_INVITE_REJECTED";
|
|
2001
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["CLIENT_INVITE_REGISTERED"] = 3004] = "CLIENT_INVITE_REGISTERED";
|
|
2002
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["FIRM_NEW_CLIENT"] = 3005] = "FIRM_NEW_CLIENT";
|
|
2003
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["FIRM_LOST_CLIENT"] = 3006] = "FIRM_LOST_CLIENT";
|
|
2004
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["EMPLOYEE_INVITE"] = 3010] = "EMPLOYEE_INVITE";
|
|
2005
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["EMPLOYEE_LOST_CLIENT"] = 3011] = "EMPLOYEE_LOST_CLIENT";
|
|
2006
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["EMPLOYEE_NEW_CLIENT"] = 3012] = "EMPLOYEE_NEW_CLIENT";
|
|
2007
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["EMPLOYEE_INVITE_ACCEPTED"] = 3013] = "EMPLOYEE_INVITE_ACCEPTED";
|
|
2008
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["EMAIL_CONFIRMED"] = 3020] = "EMAIL_CONFIRMED";
|
|
2009
|
+
UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["TAX_REVIEW_REQUESTED"] = 3030] = "TAX_REVIEW_REQUESTED";
|
|
2010
|
+
})(UserEventTypeEmployeeTypeEnum || (UserEventTypeEmployeeTypeEnum = {}));
|
|
2011
|
+
|
|
2012
|
+
var UserEventTypeClientTypeEnum;
|
|
2013
|
+
(function (UserEventTypeClientTypeEnum) {
|
|
2014
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
|
|
2015
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
|
|
2016
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
|
|
2017
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
|
|
2018
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
|
|
2019
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
|
|
2020
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
|
|
2021
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
|
|
2022
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
|
|
2023
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE"] = 2020] = "CO_OWNER_INVITE";
|
|
2024
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_TO_REGISTER"] = 2021] = "CO_OWNER_INVITE_TO_REGISTER";
|
|
2025
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_ACCEPTED"] = 2022] = "CO_OWNER_INVITE_ACCEPTED";
|
|
2026
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_REJECTED"] = 2023] = "CO_OWNER_INVITE_REJECTED";
|
|
2027
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_REGISTERED"] = 2024] = "CO_OWNER_INVITE_REGISTERED";
|
|
2028
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_CHANGE_REQUESTED"] = 2025] = "CO_OWNER_CHANGE_REQUESTED";
|
|
2029
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_CHANGE_ACCEPTED"] = 2026] = "CO_OWNER_CHANGE_ACCEPTED";
|
|
2030
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_CHANGE_REJECTED"] = 2027] = "CO_OWNER_CHANGE_REJECTED";
|
|
2031
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
|
|
2032
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
|
|
2033
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
|
|
2034
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
|
|
2035
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
|
|
2036
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
|
|
2037
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["EMAIL_CONFIRMED"] = 2050] = "EMAIL_CONFIRMED";
|
|
2038
|
+
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
|
|
2039
|
+
})(UserEventTypeClientTypeEnum || (UserEventTypeClientTypeEnum = {}));
|
|
2119
2040
|
|
|
2120
2041
|
var UserMedicareExemptionEnum;
|
|
2121
2042
|
(function (UserMedicareExemptionEnum) {
|
|
@@ -2224,11 +2145,7 @@ __decorate([
|
|
|
2224
2145
|
class Bank$1 {
|
|
2225
2146
|
}
|
|
2226
2147
|
|
|
2227
|
-
|
|
2228
|
-
constructor(environment) {
|
|
2229
|
-
super();
|
|
2230
|
-
this.environment = environment;
|
|
2231
|
-
}
|
|
2148
|
+
class Bank extends Bank$1 {
|
|
2232
2149
|
getInitials() {
|
|
2233
2150
|
return this.name[0] + this.name[1];
|
|
2234
2151
|
}
|
|
@@ -2236,12 +2153,9 @@ let Bank = class Bank extends Bank$1 {
|
|
|
2236
2153
|
if (!this.logo) {
|
|
2237
2154
|
return null;
|
|
2238
2155
|
}
|
|
2239
|
-
return this.logo.includes('http') ? `${this.logo}` : `${
|
|
2156
|
+
return this.logo.includes('http') ? `${this.logo}` : `${localStorage.getItem('api_uri')}/${this.logo}`;
|
|
2240
2157
|
}
|
|
2241
|
-
}
|
|
2242
|
-
Bank = __decorate([
|
|
2243
|
-
__param(0, Inject('environment'))
|
|
2244
|
-
], Bank);
|
|
2158
|
+
}
|
|
2245
2159
|
|
|
2246
2160
|
class BankAccount$1 {
|
|
2247
2161
|
}
|
|
@@ -2966,6 +2880,12 @@ class BasiqJob extends BasiqJob$1 {
|
|
|
2966
2880
|
}
|
|
2967
2881
|
|
|
2968
2882
|
class BankConnection extends BankConnection$1 {
|
|
2883
|
+
/**
|
|
2884
|
+
* Check if status of connection is inactive (invalid)
|
|
2885
|
+
*/
|
|
2886
|
+
isInactive() {
|
|
2887
|
+
return this.status === BankConnectionStatusEnum.INVALID;
|
|
2888
|
+
}
|
|
2969
2889
|
}
|
|
2970
2890
|
__decorate([
|
|
2971
2891
|
Type(() => BasiqJob)
|
|
@@ -4326,6 +4246,59 @@ class ClientPortfolioChartData {
|
|
|
4326
4246
|
class ClientPortfolioReport {
|
|
4327
4247
|
}
|
|
4328
4248
|
|
|
4249
|
+
/**
|
|
4250
|
+
* Class to generate data-table structure based on provided collection.
|
|
4251
|
+
* Use to work with HTML/PDF/XLSX tables
|
|
4252
|
+
*/
|
|
4253
|
+
class DataTable {
|
|
4254
|
+
constructor(collection, columns, caption, footerCaption) {
|
|
4255
|
+
this.caption = caption;
|
|
4256
|
+
this.columns = columns;
|
|
4257
|
+
this.setRows(collection);
|
|
4258
|
+
if (footerCaption) {
|
|
4259
|
+
this.setFooterRow(collection, footerCaption);
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
setRows(collection) {
|
|
4263
|
+
this.rows = collection.items.map((item) => {
|
|
4264
|
+
// parse table columns to return items based on column properties
|
|
4265
|
+
return this.columns.map((column) => {
|
|
4266
|
+
// if the pipe is provided - transform the return value
|
|
4267
|
+
if (column.pipe) {
|
|
4268
|
+
return column.pipe.transform(item[column.key]);
|
|
4269
|
+
}
|
|
4270
|
+
return (item[column.key] ? item[column.key] : '-').toString();
|
|
4271
|
+
});
|
|
4272
|
+
});
|
|
4273
|
+
}
|
|
4274
|
+
setFooterRow(collection, footerCaption) {
|
|
4275
|
+
this.footerRow = this.columns.map((column, index) => {
|
|
4276
|
+
if (index === 0) {
|
|
4277
|
+
return footerCaption.toString();
|
|
4278
|
+
}
|
|
4279
|
+
if (!column.total) {
|
|
4280
|
+
return '';
|
|
4281
|
+
}
|
|
4282
|
+
return collection.items
|
|
4283
|
+
.reduce((sum, item) => sum + Number(item[column.key]), 0)
|
|
4284
|
+
.toString();
|
|
4285
|
+
});
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
|
|
4289
|
+
class DataTableColumn {
|
|
4290
|
+
constructor(name, key, total, pipe) {
|
|
4291
|
+
/**
|
|
4292
|
+
* Flag that shows should the column be in the total calculation or not
|
|
4293
|
+
*/
|
|
4294
|
+
this.total = false;
|
|
4295
|
+
this.name = name;
|
|
4296
|
+
this.key = key;
|
|
4297
|
+
this.total = total;
|
|
4298
|
+
this.pipe = pipe;
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4301
|
+
|
|
4329
4302
|
var DepreciationGroupEnum;
|
|
4330
4303
|
(function (DepreciationGroupEnum) {
|
|
4331
4304
|
DepreciationGroupEnum[DepreciationGroupEnum["BUILDING_IMPROVEMENTS"] = 0] = "BUILDING_IMPROVEMENTS";
|
|
@@ -4635,6 +4608,8 @@ const ENDPOINTS = {
|
|
|
4635
4608
|
USER_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/users\\/photo\.\*'),
|
|
4636
4609
|
USER_STATUS_PUT: new Endpoint('PUT', '\\/users\\/status'),
|
|
4637
4610
|
VEHICLES_GET: new Endpoint('GET', '\\/vehicles'),
|
|
4611
|
+
VEHICLES_POST: new Endpoint('POST', '\\/vehicles'),
|
|
4612
|
+
VEHICLES_PUT: new Endpoint('PUT', '\\/vehicles\\/\\d+'),
|
|
4638
4613
|
VEHICLE_CLAIMS_GET: new Endpoint('GET', '\\/vehicle-claims'),
|
|
4639
4614
|
VEHICLE_CLAIMS_POST: new Endpoint('POST', '\\/vehicle-claims'),
|
|
4640
4615
|
VEHICLE_LOGBOOK_POST: new Endpoint('POST', '\\/vehicles\\/\\d+\\/logbooks'),
|
|
@@ -4860,75 +4835,9 @@ class VehicleClaim extends VehicleClaim$1 {
|
|
|
4860
4835
|
class ServiceNotification {
|
|
4861
4836
|
}
|
|
4862
4837
|
|
|
4863
|
-
/**
|
|
4864
|
-
* Notification events grouped by types
|
|
4865
|
-
*/
|
|
4866
|
-
const NOTIFICATION_EVENT_TYPES = {
|
|
4867
|
-
// events from employees to clients
|
|
4868
|
-
employeeInvite: [
|
|
4869
|
-
UserEventTypeTypeEnum.EMPLOYEE_INVITE_TO_REGISTER_ACCEPTED,
|
|
4870
|
-
UserEventTypeTypeEnum.EMPLOYEE_INVITE_TO_JOIN_ACCEPTED,
|
|
4871
|
-
UserEventTypeTypeEnum.EMPLOYEE_INVITE_TO_JOIN_REJECTED,
|
|
4872
|
-
UserEventTypeTypeEnum.EMPLOYEE_INVITE_TO_REGISTER,
|
|
4873
|
-
UserEventTypeTypeEnum.CLIENT_INVITE_TO_JOIN,
|
|
4874
|
-
],
|
|
4875
|
-
// events from clients to employee
|
|
4876
|
-
employeeInviteFromClient: [
|
|
4877
|
-
UserEventTypeTypeEnum.EMPLOYEE_INVITE_TO_JOIN,
|
|
4878
|
-
],
|
|
4879
|
-
bankConnection: [
|
|
4880
|
-
UserEventTypeTypeEnum.BASIQ_NEW_ACCOUNTS,
|
|
4881
|
-
UserEventTypeTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE,
|
|
4882
|
-
UserEventTypeTypeEnum.BASIQ_AUTHORIZATION_FAIL
|
|
4883
|
-
],
|
|
4884
|
-
clientInvite: [
|
|
4885
|
-
UserEventTypeTypeEnum.CLIENT_INVITE_TO_JOIN_ACCEPTED,
|
|
4886
|
-
UserEventTypeTypeEnum.CLIENT_INVITE_TO_JOIN_REJECTED,
|
|
4887
|
-
UserEventTypeTypeEnum.CLIENT_INVITE_TO_REGISTER
|
|
4888
|
-
],
|
|
4889
|
-
clientMovement: [
|
|
4890
|
-
UserEventTypeTypeEnum.CLIENT_LEFT_FIRM,
|
|
4891
|
-
UserEventTypeTypeEnum.EMPLOYEE_LOST_CLIENT,
|
|
4892
|
-
UserEventTypeTypeEnum.EMPLOYEE_RECEIVED_CLIENT
|
|
4893
|
-
],
|
|
4894
|
-
propertyOwner: [
|
|
4895
|
-
UserEventTypeTypeEnum.CO_OWNER_INVITE_SEND,
|
|
4896
|
-
UserEventTypeTypeEnum.CO_OWNER_INVITE_ACCEPT,
|
|
4897
|
-
UserEventTypeTypeEnum.CO_OWNER_INVITE_REJECT,
|
|
4898
|
-
UserEventTypeTypeEnum.CO_OWNER_REGISTER,
|
|
4899
|
-
UserEventTypeTypeEnum.CO_OWNER_CHANGES_OFFER,
|
|
4900
|
-
UserEventTypeTypeEnum.CO_OWNER_CHANGES_ACCEPT,
|
|
4901
|
-
UserEventTypeTypeEnum.CO_OWNER_CHANGES_REJECT
|
|
4902
|
-
]
|
|
4903
|
-
};
|
|
4904
|
-
|
|
4905
4838
|
class Notification extends ServiceNotification {
|
|
4906
4839
|
get eventType() {
|
|
4907
|
-
return this.userEvent.
|
|
4908
|
-
}
|
|
4909
|
-
/**
|
|
4910
|
-
* Set redirection link based on current event type
|
|
4911
|
-
*/
|
|
4912
|
-
setRedirectionLink() {
|
|
4913
|
-
switch (true) {
|
|
4914
|
-
case NOTIFICATION_EVENT_TYPES.employeeInvite.includes(this.eventType):
|
|
4915
|
-
this.redirectionLink = '/client/users/firms';
|
|
4916
|
-
break;
|
|
4917
|
-
case NOTIFICATION_EVENT_TYPES.bankConnection.includes(this.eventType):
|
|
4918
|
-
this.redirectionLink = '/client/bank-feeds';
|
|
4919
|
-
break;
|
|
4920
|
-
case NOTIFICATION_EVENT_TYPES.clientInvite.includes(this.eventType):
|
|
4921
|
-
this.redirectionLink = '/client/users/invitations';
|
|
4922
|
-
break;
|
|
4923
|
-
case NOTIFICATION_EVENT_TYPES.propertyOwner.includes(this.eventType):
|
|
4924
|
-
this.redirectionLink = '/client/users/co-owners';
|
|
4925
|
-
break;
|
|
4926
|
-
case NOTIFICATION_EVENT_TYPES.employeeInviteFromClient.includes(this.eventType):
|
|
4927
|
-
this.redirectionLink = '/firm/clients/invites';
|
|
4928
|
-
break;
|
|
4929
|
-
default:
|
|
4930
|
-
this.redirectionLink = '';
|
|
4931
|
-
}
|
|
4840
|
+
return this.userEvent.type.type;
|
|
4932
4841
|
}
|
|
4933
4842
|
/**
|
|
4934
4843
|
* Check if notification is from user or not
|
|
@@ -4944,16 +4853,17 @@ __decorate([
|
|
|
4944
4853
|
Expose({ toClassOnly: true }),
|
|
4945
4854
|
Transform(({ obj }) => {
|
|
4946
4855
|
switch (true) {
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4856
|
+
// @TODO vik
|
|
4857
|
+
// case NOTIFICATION_EVENT_TYPES.employeeInvite.includes(obj.eventType):
|
|
4858
|
+
// return '/client/users/firms';
|
|
4859
|
+
// case NOTIFICATION_EVENT_TYPES.bankConnection.includes(obj.eventType):
|
|
4860
|
+
// return '/client/bank-feeds';
|
|
4861
|
+
// case NOTIFICATION_EVENT_TYPES.clientInvite.includes(obj.eventType):
|
|
4862
|
+
// return '/client/users/invitations';
|
|
4863
|
+
// case NOTIFICATION_EVENT_TYPES.propertyOwner.includes(obj.eventType):
|
|
4864
|
+
// return '/client/users/co-owners';
|
|
4865
|
+
// case NOTIFICATION_EVENT_TYPES.employeeInviteFromClient.includes(obj.eventType):
|
|
4866
|
+
// return '/firm/clients/invites';
|
|
4957
4867
|
default:
|
|
4958
4868
|
return '';
|
|
4959
4869
|
}
|
|
@@ -5572,6 +5482,46 @@ const USER_ROLES = {
|
|
|
5572
5482
|
class UserToRegister {
|
|
5573
5483
|
}
|
|
5574
5484
|
|
|
5485
|
+
class UserEventTypeCategory$1 {
|
|
5486
|
+
}
|
|
5487
|
+
|
|
5488
|
+
class UserEventTypeCategory extends UserEventTypeCategory$1 {
|
|
5489
|
+
}
|
|
5490
|
+
|
|
5491
|
+
class UserEventSetting$1 {
|
|
5492
|
+
}
|
|
5493
|
+
|
|
5494
|
+
class UserEventType$1 {
|
|
5495
|
+
}
|
|
5496
|
+
|
|
5497
|
+
class UserEventType extends UserEventType$1 {
|
|
5498
|
+
toSetting() {
|
|
5499
|
+
return plainToClass(UserEventSetting, {
|
|
5500
|
+
byEmail: this.byEmail,
|
|
5501
|
+
byNotification: this.byNotification,
|
|
5502
|
+
frequency: this.frequency,
|
|
5503
|
+
type: this
|
|
5504
|
+
});
|
|
5505
|
+
}
|
|
5506
|
+
}
|
|
5507
|
+
__decorate([
|
|
5508
|
+
Type(() => UserEventTypeCategory)
|
|
5509
|
+
], UserEventType.prototype, "category", void 0);
|
|
5510
|
+
|
|
5511
|
+
class UserEventSetting extends UserEventSetting$1 {
|
|
5512
|
+
constructor() {
|
|
5513
|
+
super(...arguments);
|
|
5514
|
+
// flag indicates that the setting is updating now saved or not
|
|
5515
|
+
this.isUpdating = false;
|
|
5516
|
+
}
|
|
5517
|
+
}
|
|
5518
|
+
__decorate([
|
|
5519
|
+
Type(() => UserEventType)
|
|
5520
|
+
], UserEventSetting.prototype, "type", void 0);
|
|
5521
|
+
__decorate([
|
|
5522
|
+
Exclude({ toPlainOnly: true })
|
|
5523
|
+
], UserEventSetting.prototype, "isUpdating", void 0);
|
|
5524
|
+
|
|
5575
5525
|
/**
|
|
5576
5526
|
* Enum with user event setting fields
|
|
5577
5527
|
*/
|
|
@@ -6056,7 +6006,7 @@ class BankAccountService extends BaseRestService {
|
|
|
6056
6006
|
* Listen system notifications and update cache when got basiq notification received
|
|
6057
6007
|
*/
|
|
6058
6008
|
listenEvents() {
|
|
6059
|
-
this.
|
|
6009
|
+
this.listenToEventDispatcherChanges();
|
|
6060
6010
|
}
|
|
6061
6011
|
/**
|
|
6062
6012
|
* Created manual bank account
|
|
@@ -6111,10 +6061,14 @@ class BankAccountService extends BaseRestService {
|
|
|
6111
6061
|
}));
|
|
6112
6062
|
}
|
|
6113
6063
|
/**
|
|
6114
|
-
* Listen to EventDispatcherService
|
|
6064
|
+
* Listen to EventDispatcherService events
|
|
6115
6065
|
*/
|
|
6116
|
-
|
|
6117
|
-
this.eventDispatcherService.on([
|
|
6066
|
+
listenToEventDispatcherChanges() {
|
|
6067
|
+
this.eventDispatcherService.on([
|
|
6068
|
+
AppEventTypeEnum.PROPERTY_OWNER_UPDATED,
|
|
6069
|
+
AppEventTypeEnum.LOAN_PAYOUT_UPDATED,
|
|
6070
|
+
AppEventTypeEnum.BANK_CONNECTION_ADDED
|
|
6071
|
+
]).subscribe(() => {
|
|
6118
6072
|
this.fetch().subscribe((bankAccounts) => {
|
|
6119
6073
|
this.cache = bankAccounts;
|
|
6120
6074
|
this.updateCache();
|
|
@@ -6235,6 +6189,10 @@ class BankConnectionService extends BaseRestService {
|
|
|
6235
6189
|
this.environment = environment;
|
|
6236
6190
|
this.modelClass = BankConnection;
|
|
6237
6191
|
this.url = 'bank-connections';
|
|
6192
|
+
this.listenEvents();
|
|
6193
|
+
}
|
|
6194
|
+
listenEvents() {
|
|
6195
|
+
this.listenToAddedBankAccounts();
|
|
6238
6196
|
}
|
|
6239
6197
|
post(bankConnection) {
|
|
6240
6198
|
return this.http.post(`${this.environment.apiV2}/${this.url}`, bankConnection)
|
|
@@ -6243,6 +6201,11 @@ class BankConnectionService extends BaseRestService {
|
|
|
6243
6201
|
return plainToClass(BankConnection, bankConnectionBase);
|
|
6244
6202
|
}));
|
|
6245
6203
|
}
|
|
6204
|
+
listenToAddedBankAccounts() {
|
|
6205
|
+
this.eventDispatcherService.on(AppEventTypeEnum.BANK_ACCOUNT_CREATED).subscribe(() => {
|
|
6206
|
+
this.resetCache();
|
|
6207
|
+
});
|
|
6208
|
+
}
|
|
6246
6209
|
}
|
|
6247
6210
|
BankConnectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BankConnectionService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6248
6211
|
BankConnectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: BankConnectionService, providedIn: 'root' });
|
|
@@ -6316,7 +6279,7 @@ class BankTransactionService extends BaseRestService {
|
|
|
6316
6279
|
}
|
|
6317
6280
|
listenBankTransactionsImport() {
|
|
6318
6281
|
this.eventDispatcherService.on(AppEventTypeEnum.NOTIFICATION_ADDED).subscribe((notification) => {
|
|
6319
|
-
if (!notification.isRead && notification.eventType ===
|
|
6282
|
+
if (!notification.isRead && notification.eventType === UserEventTypeClientTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE) {
|
|
6320
6283
|
this.resetCache();
|
|
6321
6284
|
}
|
|
6322
6285
|
});
|
|
@@ -6398,7 +6361,7 @@ class BasiqService extends BaseRestService {
|
|
|
6398
6361
|
*/
|
|
6399
6362
|
listenNotifications() {
|
|
6400
6363
|
this.eventDispatcherService.on(AppEventTypeEnum.NOTIFICATION_ADDED).subscribe((notification) => {
|
|
6401
|
-
if (!notification.isRead && notification.eventType ===
|
|
6364
|
+
if (!notification.isRead && notification.eventType === UserEventTypeClientTypeEnum.BASIQ_NEW_ACCOUNTS) {
|
|
6402
6365
|
this.resetCache();
|
|
6403
6366
|
this.get().subscribe();
|
|
6404
6367
|
}
|
|
@@ -7421,14 +7384,14 @@ class FirmService {
|
|
|
7421
7384
|
register(data) {
|
|
7422
7385
|
return this.http.post(`${this.environment.apiV2}/firms/registration`, data)
|
|
7423
7386
|
.pipe(map((firm) => {
|
|
7424
|
-
return plainToClass(Firm
|
|
7387
|
+
return plainToClass(Firm, firm);
|
|
7425
7388
|
}));
|
|
7426
7389
|
}
|
|
7427
7390
|
get() {
|
|
7428
7391
|
if (!this.firm) {
|
|
7429
7392
|
this.http.get(`${this.environment.apiV2}/firms/current`)
|
|
7430
7393
|
.pipe(map((firm) => {
|
|
7431
|
-
return plainToClass(Firm
|
|
7394
|
+
return plainToClass(Firm, firm);
|
|
7432
7395
|
}))
|
|
7433
7396
|
.subscribe((firm) => {
|
|
7434
7397
|
this.firm = firm;
|
|
@@ -7440,7 +7403,7 @@ class FirmService {
|
|
|
7440
7403
|
update(firm) {
|
|
7441
7404
|
return this.http.put(`${this.environment.apiV2}/firms/current`, firm)
|
|
7442
7405
|
.pipe(map((updatedItem) => {
|
|
7443
|
-
const updatedInstance = plainToClass(Firm
|
|
7406
|
+
const updatedInstance = plainToClass(Firm, updatedItem);
|
|
7444
7407
|
this.firmSubject.next(updatedInstance);
|
|
7445
7408
|
}));
|
|
7446
7409
|
}
|
|
@@ -7450,7 +7413,7 @@ class FirmService {
|
|
|
7450
7413
|
getAll() {
|
|
7451
7414
|
return this.http.get(`${this.environment.apiV2}/firms`)
|
|
7452
7415
|
.pipe(map((response) => {
|
|
7453
|
-
return response['hydra:member'].map((firmBase) => plainToClass(Firm
|
|
7416
|
+
return response['hydra:member'].map((firmBase) => plainToClass(Firm, firmBase));
|
|
7454
7417
|
}));
|
|
7455
7418
|
}
|
|
7456
7419
|
getByType(type) {
|
|
@@ -7461,7 +7424,7 @@ class FirmService {
|
|
|
7461
7424
|
updatePhoto(firm, photo) {
|
|
7462
7425
|
return this.http.post(`${this.environment.apiV2}/firms/photo?_method=PUT`, photo)
|
|
7463
7426
|
.pipe(map((firmPhoto) => {
|
|
7464
|
-
this.firm = plainToClass(Firm
|
|
7427
|
+
this.firm = plainToClass(Firm, Object.assign(firm, { photo: firmPhoto }));
|
|
7465
7428
|
this.firmSubject.next(this.firm);
|
|
7466
7429
|
return firm;
|
|
7467
7430
|
}));
|
|
@@ -7980,6 +7943,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
7980
7943
|
args: ['environment']
|
|
7981
7944
|
}] }, { type: SseService }]; } });
|
|
7982
7945
|
|
|
7946
|
+
/**
|
|
7947
|
+
* Configuration file with the settings to generate PDF file
|
|
7948
|
+
*/
|
|
7949
|
+
const PDF_CONFIG = {
|
|
7950
|
+
text: {
|
|
7951
|
+
fontSize: 18,
|
|
7952
|
+
fontName: 'helvetica',
|
|
7953
|
+
fontStyle: '',
|
|
7954
|
+
fontWeight: 'bold',
|
|
7955
|
+
positionX: 14,
|
|
7956
|
+
positionY: 10,
|
|
7957
|
+
fillColor: 255,
|
|
7958
|
+
textColor: 0
|
|
7959
|
+
},
|
|
7960
|
+
// coords for file section title (group, table, e.t.c.)
|
|
7961
|
+
contentTitleCoords: {
|
|
7962
|
+
marginTop: 20
|
|
7963
|
+
},
|
|
7964
|
+
contentCoords: {
|
|
7965
|
+
marginTop: 15,
|
|
7966
|
+
marginLeft: 14
|
|
7967
|
+
}
|
|
7968
|
+
};
|
|
7969
|
+
|
|
7970
|
+
/**
|
|
7971
|
+
* Service to work with PDF (generate, download, e.t.c.)
|
|
7972
|
+
*/
|
|
7973
|
+
class PdfService {
|
|
7974
|
+
// @Todo remove 'any' type
|
|
7975
|
+
/**
|
|
7976
|
+
* Download generated PDF file
|
|
7977
|
+
*/
|
|
7978
|
+
download(tables, title, fileName) {
|
|
7979
|
+
const document = this.generatePdfFile(tables, title);
|
|
7980
|
+
document.save(`${fileName}.pdf`);
|
|
7981
|
+
}
|
|
7982
|
+
/**
|
|
7983
|
+
* Generate PDF file from provided data
|
|
7984
|
+
*/
|
|
7985
|
+
generatePdfFile(tables, title) {
|
|
7986
|
+
const pdf = new jsPDF();
|
|
7987
|
+
// set document title
|
|
7988
|
+
pdf.setFontSize(PDF_CONFIG.text.fontSize);
|
|
7989
|
+
pdf.setFont(PDF_CONFIG.text.fontName, PDF_CONFIG.text.fontStyle, PDF_CONFIG.text.fontWeight);
|
|
7990
|
+
pdf.text(title, PDF_CONFIG.text.positionX, PDF_CONFIG.text.positionY);
|
|
7991
|
+
tables.forEach((table) => {
|
|
7992
|
+
// coords of last table
|
|
7993
|
+
const lastTableCoords = pdf['lastAutoTable'].finalY || PDF_CONFIG.contentCoords.marginTop;
|
|
7994
|
+
pdf.text(table.caption, PDF_CONFIG.contentCoords.marginLeft, lastTableCoords + PDF_CONFIG.contentCoords.marginTop);
|
|
7995
|
+
// table options
|
|
7996
|
+
const options = {
|
|
7997
|
+
startY: lastTableCoords + PDF_CONFIG.contentTitleCoords.marginTop,
|
|
7998
|
+
head: [table['columns'].map((column) => column.name)],
|
|
7999
|
+
body: table['rows'],
|
|
8000
|
+
foot: [table['footerRow']],
|
|
8001
|
+
footStyles: {
|
|
8002
|
+
fillColor: PDF_CONFIG.text.fillColor,
|
|
8003
|
+
textColor: PDF_CONFIG.text.textColor
|
|
8004
|
+
}
|
|
8005
|
+
};
|
|
8006
|
+
autoTable(pdf, options);
|
|
8007
|
+
});
|
|
8008
|
+
return pdf;
|
|
8009
|
+
}
|
|
8010
|
+
}
|
|
8011
|
+
PdfService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PdfService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8012
|
+
PdfService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PdfService, providedIn: 'root' });
|
|
8013
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PdfService, decorators: [{
|
|
8014
|
+
type: Injectable,
|
|
8015
|
+
args: [{
|
|
8016
|
+
providedIn: 'root'
|
|
8017
|
+
}]
|
|
8018
|
+
}] });
|
|
8019
|
+
|
|
7983
8020
|
class PreloaderService {
|
|
7984
8021
|
constructor() {
|
|
7985
8022
|
this.activePreloaders = new BehaviorSubject([]);
|
|
@@ -9695,6 +9732,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
9695
9732
|
args: ['environment']
|
|
9696
9733
|
}] }]; } });
|
|
9697
9734
|
|
|
9735
|
+
/**
|
|
9736
|
+
* Service to work with XLSX (generate, download, e.t.c.)
|
|
9737
|
+
*/
|
|
9738
|
+
class XlsxService {
|
|
9739
|
+
// @Todo remove 'any' type
|
|
9740
|
+
/**s
|
|
9741
|
+
* Download generated Excel file
|
|
9742
|
+
*/
|
|
9743
|
+
download(tables, title, fileName) {
|
|
9744
|
+
const excelFile = this.generateFile(tables, title);
|
|
9745
|
+
const data = new Blob([excelFile], {
|
|
9746
|
+
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8'
|
|
9747
|
+
});
|
|
9748
|
+
FileSaver.saveAs(data, `${fileName}.xlsx`);
|
|
9749
|
+
}
|
|
9750
|
+
generateFile(tables, title) {
|
|
9751
|
+
// create new workbook
|
|
9752
|
+
const workbook = xlsx.utils.book_new();
|
|
9753
|
+
// create empty worksheet
|
|
9754
|
+
const worksheet = {
|
|
9755
|
+
SheetNames: [],
|
|
9756
|
+
Sheets: {}
|
|
9757
|
+
};
|
|
9758
|
+
const sheetData = tables.map((table) => {
|
|
9759
|
+
// add caption, columns, rows and footer rows
|
|
9760
|
+
return [
|
|
9761
|
+
[table.caption],
|
|
9762
|
+
table.columns.map((column) => column.name),
|
|
9763
|
+
...table.rows,
|
|
9764
|
+
table.footerRow,
|
|
9765
|
+
];
|
|
9766
|
+
});
|
|
9767
|
+
sheetData.forEach((data) => {
|
|
9768
|
+
xlsx.utils.sheet_add_json(worksheet, data, { origin: -1, skipHeader: true });
|
|
9769
|
+
// set empty row after each table
|
|
9770
|
+
xlsx.utils.sheet_add_json(worksheet, [], { origin: -1 });
|
|
9771
|
+
});
|
|
9772
|
+
xlsx.utils.book_append_sheet(workbook, worksheet);
|
|
9773
|
+
return xlsx.write(workbook, { bookType: 'xlsx', type: 'array' });
|
|
9774
|
+
}
|
|
9775
|
+
}
|
|
9776
|
+
XlsxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: XlsxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9777
|
+
XlsxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: XlsxService, providedIn: 'root' });
|
|
9778
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: XlsxService, decorators: [{
|
|
9779
|
+
type: Injectable,
|
|
9780
|
+
args: [{
|
|
9781
|
+
providedIn: 'root'
|
|
9782
|
+
}]
|
|
9783
|
+
}] });
|
|
9784
|
+
|
|
9698
9785
|
// deep clone for entity
|
|
9699
9786
|
function cloneDeep(array) {
|
|
9700
9787
|
return JSON.parse(JSON.stringify(array));
|
|
@@ -9773,5 +9860,5 @@ function taxReviewFilterPredicate(data, filter) {
|
|
|
9773
9860
|
* Generated bundle index. Do not edit.
|
|
9774
9861
|
*/
|
|
9775
9862
|
|
|
9776
|
-
export { AbstractCollection, Address, AddressService, AddressTypeEnum, AppEvent, AppEventTypeEnum, AssetEntityTypeEnum, AssetTypeEnum, AssetsService, AuthService, BANK_ACCOUNT_TYPES, Bank, BankAccount, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankConnection, BankConnectionService, BankConnectionStatusEnum, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasiqJob, BasiqService, BasiqToken, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CapitalProjectService, ChartAccounts, ChartAccountsCategoryEnum, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsListEnum, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartData, ChartSerie, Chat, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientDetails, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientInvite, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, CollectionDictionary, CorelogicService, CorelogicSuggestion, Country, DEFAULT_VEHICLE_EXPENSE, DEPRECIATION_GROUPS, DOCUMENT_FILE_TYPES, Depreciation, DepreciationCalculationEnum, DepreciationCalculationPercentEnum, DepreciationCapitalProject, DepreciationCollection, DepreciationForecast, DepreciationForecastCollection, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationReceipt, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeInvite, EmployeeInviteService, EmployeeService, Endpoint, EventDispatcherService, FinancialYear, Firm, FirmService, FirmTypeEnum, HeaderTitleService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSalaryEnum, IncomeSourceTypeListWorkEnum, IntercomService, InviteStatusEnum, JwtService, Loan, LoanBankTypeEnum, LoanCollection, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookCollection, LogbookPeriod, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum,
|
|
9863
|
+
export { AbstractCollection, Address, AddressService, AddressTypeEnum, AppEvent, AppEventTypeEnum, AssetEntityTypeEnum, AssetTypeEnum, AssetsService, AuthService, BANK_ACCOUNT_TYPES, Bank, BankAccount, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankConnection, BankConnectionService, BankConnectionStatusEnum, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasiqJob, BasiqService, BasiqToken, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CapitalProjectService, ChartAccounts, ChartAccountsCategoryEnum, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsListEnum, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartData, ChartSerie, Chat, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientDetails, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientInvite, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, CollectionDictionary, CorelogicService, CorelogicSuggestion, Country, DEFAULT_VEHICLE_EXPENSE, DEPRECIATION_GROUPS, DOCUMENT_FILE_TYPES, DataTable, DataTableColumn, Depreciation, DepreciationCalculationEnum, DepreciationCalculationPercentEnum, DepreciationCapitalProject, DepreciationCollection, DepreciationForecast, DepreciationForecastCollection, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationReceipt, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeInvite, EmployeeInviteService, EmployeeService, Endpoint, EventDispatcherService, FinancialYear, Firm, FirmService, FirmTypeEnum, HeaderTitleService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSalaryEnum, IncomeSourceTypeListWorkEnum, IntercomService, InviteStatusEnum, JwtService, Loan, LoanBankTypeEnum, LoanCollection, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookCollection, LogbookPeriod, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, Notification, NotificationService, Occupation, OccupationService, OwnershipFilterOptionsEnum, PdfService, Phone, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCapitalCost, PropertyCapitalCostService, PropertyCategory, PropertyCategoryMovement, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyOwner, PropertyOwnerAccessEnum, PropertyOwnerService, PropertyOwnerStatusEnum, PropertyService, PropertySold, PropertySoldService, PropertySubscription, PropertyValuation, RegistrationInvite, RegistrationInviteStatusEnum, SUBSCRIPTION_DESCRIPTION, SUBSCRIPTION_TITLE, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentStatusEnum, ServicePrice, ServicePriceCollection, ServicePriceRecurringIntervalEnum, ServicePriceTypeEnum, ServiceProduct, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, SpareDocumentSpareTypeEnum, SseService, SubscriptionService, SubscriptionTypeEnum, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxReturnCategoryItem, TaxReturnCategoryItemCollection, TaxReturnCategoryItemDetails, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReview, TaxReviewCollection, TaxReviewHistoryService, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionCalculationService, TransactionCollection, TransactionMetadata, TransactionOperationEnum, TransactionReceipt, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserMedicareExemptionEnum, UserRolesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, Vehicle, VehicleClaim, VehicleClaimMethodEnum, VehicleLogbook, VehicleLogbookPurposeEnum, WORK_TANK_LOGBOOK_PURPOSE_OPTIONS, WorkTankService, XlsxService, cloneDeep, compare, compareMatOptions, createDate, displayMatOptions, enumToList, getDocIcon, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate };
|
|
9777
9864
|
//# sourceMappingURL=taxtank-core.js.map
|