taxtank-core 0.28.17 → 0.28.20

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.
Files changed (33) hide show
  1. package/bundles/taxtank-core.umd.js +194 -109
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/chat.collection.js +26 -0
  4. package/esm2015/lib/collections/message.collection.js +13 -1
  5. package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +2 -2
  6. package/esm2015/lib/db/Enums/chat-status.enum.js +1 -1
  7. package/esm2015/lib/db/Models/property/property-forecast.js +1 -1
  8. package/esm2015/lib/db/Models/property/property.js +1 -1
  9. package/esm2015/lib/forms/sole/sole-business.form.js +3 -3
  10. package/esm2015/lib/forms/sole/sole-invoice.form.js +3 -2
  11. package/esm2015/lib/models/bank/bank-account.js +7 -1
  12. package/esm2015/lib/models/chart-accounts/chart-accounts.js +7 -1
  13. package/esm2015/lib/models/chat/message.js +5 -1
  14. package/esm2015/lib/models/event/app-event-type.enum.js +36 -35
  15. package/esm2015/lib/models/property/property.js +4 -1
  16. package/esm2015/lib/services/http/property/property.service.js +4 -1
  17. package/esm2015/lib/services/http/transaction/transaction.service.js +11 -1
  18. package/esm2015/public-api.js +2 -1
  19. package/fesm2015/taxtank-core.js +163 -98
  20. package/fesm2015/taxtank-core.js.map +1 -1
  21. package/lib/collections/chat.collection.d.ts +10 -0
  22. package/lib/collections/message.collection.d.ts +5 -0
  23. package/lib/db/Enums/chart-accounts-list.enum.d.ts +2 -2
  24. package/lib/db/Models/property/property-forecast.d.ts +1 -0
  25. package/lib/db/Models/property/property.d.ts +0 -1
  26. package/lib/models/bank/bank-account.d.ts +2 -0
  27. package/lib/models/chart-accounts/chart-accounts.d.ts +4 -0
  28. package/lib/models/chat/message.d.ts +2 -0
  29. package/lib/models/event/app-event-type.enum.d.ts +35 -34
  30. package/lib/models/property/property.d.ts +1 -0
  31. package/lib/services/http/transaction/transaction.service.d.ts +7 -1
  32. package/package.json +1 -1
  33. package/public-api.d.ts +1 -0
@@ -0,0 +1,10 @@
1
+ import { Collection } from './collection';
2
+ import { Chat } from '../models/chat/chat';
3
+ import { Message } from '../models/chat/message';
4
+ export declare class ChatCollection extends Collection<Chat> {
5
+ /**
6
+ * Sort chats by last messages (newest first) + empty chats in the end
7
+ */
8
+ getSortedByNewest(messages: Message[]): this;
9
+ getActive(): this;
10
+ }
@@ -7,6 +7,11 @@ export declare class MessageCollection extends Collection<Message> {
7
7
  * Get List of unread chats
8
8
  */
9
9
  getUnread(): Message[];
10
+ getFromActiveChats(): this;
11
+ /**
12
+ * Get amount of chats that contains unread messages
13
+ */
14
+ getUnreadChatsAmount(isFromEmployee?: boolean): number;
10
15
  /**
11
16
  * Check if chat has unread chats
12
17
  */
@@ -17,7 +17,6 @@ export declare enum ChartAccountsListEnum {
17
17
  DIVIDENDS = 542,
18
18
  TRANSFER = 615,
19
19
  BUILDING_AT_COST = 304,
20
- MANAGEMENT_FEES_PLATFORM_FEES = 656,
21
20
  KLMS_TRAVELLED_FOR_WORK = 24,
22
21
  KLMS_TRAVELLED = 683,
23
22
  DIRECTOR_FEES = 6,
@@ -54,5 +53,6 @@ export declare enum ChartAccountsListEnum {
54
53
  CODE_B_SUPERANNUATION_INCOME_STREAMS_DISABILITY = 558,
55
54
  CODE_A_SUPERANNUATION_INCOME_STREAMS_DEATH = 640,
56
55
  PERSONAL_EXPENSES = 628,
57
- PERSONAL_INCOME = 630
56
+ PERSONAL_INCOME = 630,
57
+ PLATFORM_FEES = 857
58
58
  }
@@ -12,4 +12,5 @@ export declare class PropertyForecast extends AbstractModel {
12
12
  createdAt?: Date;
13
13
  updatedAt?: Date;
14
14
  property?: Property;
15
+ claimPercent?: number;
15
16
  }
@@ -19,7 +19,6 @@ export declare class Property extends AbstractModel {
19
19
  settlementDate?: Date;
20
20
  depreciationCalculation?: PropertyDepreciationCalculationEnum;
21
21
  shareWith?: string;
22
- claimPercent?: number;
23
22
  growthPercent?: number;
24
23
  subscriptions?: PropertySubscription[];
25
24
  deletedAt?: Date;
@@ -15,6 +15,8 @@ export declare class BankAccount extends BankAccountBase {
15
15
  bankConnection: BankConnection;
16
16
  type: BankAccountTypeEnum;
17
17
  get bank(): Bank;
18
+ get bsb(): string;
19
+ get number(): string;
18
20
  /**
19
21
  * Get current opening balance amount
20
22
  */
@@ -63,6 +63,10 @@ export declare class ChartAccounts extends ChartAccountsBase {
63
63
  * Check if chart accounts is property expense
64
64
  */
65
65
  isPropertyExpense(): boolean;
66
+ /**
67
+ * Check if chart accounts is property income
68
+ */
69
+ isPropertyIncome(): boolean;
66
70
  isPersonal(): boolean;
67
71
  isPersonalExpense(): boolean;
68
72
  isPropertyDepreciation(): boolean;
@@ -1,9 +1,11 @@
1
1
  import { Message as MessageBase } from '../../db/Models/firm/message';
2
2
  import { User } from '../user/user';
3
3
  import { MessageDocument } from './message-document';
4
+ import { Chat } from './chat';
4
5
  export declare class Message extends MessageBase {
5
6
  createdAt: Date;
6
7
  employee: User;
8
+ chat: Chat;
7
9
  documents: MessageDocument[];
8
10
  /**
9
11
  * Check if message created today or not
@@ -28,38 +28,39 @@ export declare enum AppEventTypeEnum {
28
28
  MESSAGE_FILE_DELETED = 26,
29
29
  NOTIFICATION_ADDED = 27,
30
30
  PROPERTY_DEPRECIATION_CALCULATION_UPDATED = 28,
31
- PROPERTY_UPDATED_WITH_DOCUMENT = 29,
32
- PROPERTY_DOCUMENT_ADDED = 30,
33
- PROPERTY_MOVEMENT_CREATED = 31,
34
- PROPERTY_MOVEMENT_UPDATED = 32,
35
- PROPERTY_MOVEMENT_DELETED = 33,
36
- PROPERTY_SHARE_UPDATED = 34,
37
- PROPERTY_SALE_ADDED = 35,
38
- PROPERTY_SALE_DELETED = 36,
39
- PROPERTY_SUBSCRIPTION_ADDED = 37,
40
- PROPERTY_SUBSCRIPTION_DELETED = 38,
41
- PROPERTY_VALUATION_DOCUMENT_CREATED = 39,
42
- SERVICE_SUBSCRIPTION_UPDATED = 40,
43
- SOLE_BUSINESS_CREATED = 41,
44
- SOLE_DEPRECIATION_METHOD_UPDATED = 42,
45
- SOLE_DETAILS_CREATED = 43,
46
- SOLE_DETAILS_UPDATED = 44,
47
- TAX_REVIEW_UPDATED = 45,
48
- TRANSACTION_CREATED = 46,
49
- TRANSACTION_DELETED = 47,
50
- TRANSACTION_UPDATED = 48,
51
- TRANSACTION_UPDATED_WITH_RECEIPT = 49,
52
- TRANSACTION_UPDATED_WITH_DELETED_RECEIPT = 50,
53
- TRANSACTION_RECEIPT_CREATED = 51,
54
- TRANSACTION_RECEIPT_DELETED = 52,
55
- TRANSACTIONS_CREATED = 53,
56
- USER_UPDATED = 54,
57
- VEHICLE_CLAIM_UPDATED = 55,
58
- VEHICLE_CLAIM_CREATED = 56,
59
- VEHICLE_CLAIM_DETAILS_UPDATED = 57,
60
- VEHICLE_CLAIM_DETAILS_CREATED = 58,
61
- VEHICLE_LOGBOOK_CREATED = 59,
62
- VEHICLE_LOGBOOK_UPDATED = 60,
63
- VEHICLE_LOGBOOK_DELETED = 61,
64
- VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED = 62
31
+ PROPERTY_UPDATED = 29,
32
+ PROPERTY_UPDATED_WITH_DOCUMENT = 30,
33
+ PROPERTY_DOCUMENT_ADDED = 31,
34
+ PROPERTY_MOVEMENT_CREATED = 32,
35
+ PROPERTY_MOVEMENT_UPDATED = 33,
36
+ PROPERTY_MOVEMENT_DELETED = 34,
37
+ PROPERTY_SHARE_UPDATED = 35,
38
+ PROPERTY_SALE_ADDED = 36,
39
+ PROPERTY_SALE_DELETED = 37,
40
+ PROPERTY_SUBSCRIPTION_ADDED = 38,
41
+ PROPERTY_SUBSCRIPTION_DELETED = 39,
42
+ PROPERTY_VALUATION_DOCUMENT_CREATED = 40,
43
+ SERVICE_SUBSCRIPTION_UPDATED = 41,
44
+ SOLE_BUSINESS_CREATED = 42,
45
+ SOLE_DEPRECIATION_METHOD_UPDATED = 43,
46
+ SOLE_DETAILS_CREATED = 44,
47
+ SOLE_DETAILS_UPDATED = 45,
48
+ TAX_REVIEW_UPDATED = 46,
49
+ TRANSACTION_CREATED = 47,
50
+ TRANSACTION_DELETED = 48,
51
+ TRANSACTION_UPDATED = 49,
52
+ TRANSACTION_UPDATED_WITH_RECEIPT = 50,
53
+ TRANSACTION_UPDATED_WITH_DELETED_RECEIPT = 51,
54
+ TRANSACTION_RECEIPT_CREATED = 52,
55
+ TRANSACTION_RECEIPT_DELETED = 53,
56
+ TRANSACTIONS_CREATED = 54,
57
+ USER_UPDATED = 55,
58
+ VEHICLE_CLAIM_UPDATED = 56,
59
+ VEHICLE_CLAIM_CREATED = 57,
60
+ VEHICLE_CLAIM_DETAILS_UPDATED = 58,
61
+ VEHICLE_CLAIM_DETAILS_CREATED = 59,
62
+ VEHICLE_LOGBOOK_CREATED = 60,
63
+ VEHICLE_LOGBOOK_UPDATED = 61,
64
+ VEHICLE_LOGBOOK_DELETED = 62,
65
+ VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED = 63
65
66
  }
@@ -60,6 +60,7 @@ export declare class Property extends PropertyBase implements Photoable, Documen
60
60
  */
61
61
  get shareClaimPercent(): number;
62
62
  get actualValuation(): PropertyValuation;
63
+ get claimPercent(): number;
63
64
  get sharePercent(): number;
64
65
  get shareRatio(): number;
65
66
  get previousCategory(): PropertyCategory;
@@ -9,11 +9,12 @@ import { TransactionReceiptService } from './transaction-receipt/transaction-rec
9
9
  import { HttpClient } from '@angular/common/http';
10
10
  import { EventDispatcherService } from '../../event/event-dispatcher.service';
11
11
  import { ToastService } from '../../toast/toast.service';
12
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
12
13
  import * as i0 from "@angular/core";
13
14
  /**
14
15
  * Service for transactions business logic
15
16
  */
16
- export declare class TransactionService extends RestService<TransactionBase, Transaction> {
17
+ export declare class TransactionService extends RestService<TransactionBase, Transaction> implements IEventListener {
17
18
  protected http: HttpClient;
18
19
  protected eventDispatcherService: EventDispatcherService;
19
20
  protected environment: any;
@@ -93,6 +94,11 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
93
94
  private listenReceiptAdded;
94
95
  private listenReceiptDeleted;
95
96
  private listenVehicleClaimChanges;
97
+ /**
98
+ * property forecast includes claimPercent which affects property related expenses
99
+ * @TODO Alex move to forecast api instead of property
100
+ */
101
+ private listenPropertyForecastUpdate;
96
102
  private replaceInCache;
97
103
  static ɵfac: i0.ɵɵFactoryDeclaration<TransactionService, never>;
98
104
  static ɵprov: i0.ɵɵInjectableDeclaration<TransactionService>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.28.17",
3
+ "version": "0.28.20",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './lib/collections/account-setup-item.collection';
11
11
  export * from './lib/collections/bank-account.collection';
12
12
  export * from './lib/collections/bank-transaction.collection';
13
13
  export * from './lib/collections/chart-accounts.collection';
14
+ export * from './lib/collections/chat.collection';
14
15
  export * from './lib/collections/client.collection';
15
16
  export * from './lib/collections/client-movement.collection';
16
17
  export * from './lib/collections/client-portfolio-report.collection';