taxtank-core 0.33.57 → 0.33.59

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/esm2022/src/lib/forms/bank/bank-account/bank-account-add-manual.form.mjs +3 -4
  2. package/esm2022/src/lib/forms/bank/bank-account/bank-account-import.form.mjs +1 -1
  3. package/esm2022/src/lib/models/bank/bank-account.mjs +4 -6
  4. package/esm2022/src/lib/models/bank/index.mjs +1 -2
  5. package/esm2022/src/lib/models/dictionary/dictionary.mjs +2 -2
  6. package/esm2022/src/lib/models/report/my-tax/my-tax-business-income-or-losses/my-tax-business-losses/my-tax-business-losses.mjs +5 -4
  7. package/esm2022/src/lib/services/http/rest/http-error-messages.const.mjs +14 -0
  8. package/esm2022/src/lib/services/http/rest/index.mjs +2 -1
  9. package/esm2022/src/lib/services/http/rest/rest.service.mjs +37 -27
  10. package/esm2022/src/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.mjs +3 -1
  11. package/esm2022/src/lib/services/property/corelogic/corelogic-messages.enum.mjs +5 -0
  12. package/esm2022/src/lib/services/property/corelogic/corelogic.service.mjs +13 -7
  13. package/esm2022/src/lib/services/property/corelogic/index.mjs +2 -1
  14. package/fesm2022/taxtank-core.mjs +146 -127
  15. package/fesm2022/taxtank-core.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/src/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +2 -3
  18. package/src/lib/models/bank/bank-account.d.ts +0 -2
  19. package/src/lib/models/bank/index.d.ts +0 -1
  20. package/src/lib/models/dictionary/dictionary.d.ts +1 -1
  21. package/src/lib/services/http/rest/http-error-messages.const.d.ts +13 -0
  22. package/src/lib/services/http/rest/index.d.ts +1 -0
  23. package/src/lib/services/http/rest/rest.service.d.ts +22 -0
  24. package/src/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.d.ts +3 -0
  25. package/src/lib/services/property/corelogic/corelogic-messages.enum.d.ts +3 -0
  26. package/src/lib/services/property/corelogic/corelogic.service.d.ts +3 -1
  27. package/src/lib/services/property/corelogic/index.d.ts +1 -0
  28. package/esm2022/src/lib/models/bank/bank-account-types.const.mjs +0 -14
  29. package/src/lib/models/bank/bank-account-types.const.d.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.33.57",
3
+ "version": "0.33.59",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^17.0.0",
@@ -1,7 +1,6 @@
1
- import { BankAccount } from '../../../models/bank/bank-account';
2
- import { BankConnection } from '../../../models/bank/bank-connection';
1
+ import { BankAccount, BankConnection } from '../../../models';
3
2
  import { BankAccountAllocationForm } from './bank-account-allocation.form';
4
- import { IEventListener } from '../../../interfaces/event-listener.interface';
3
+ import { IEventListener } from '../../../interfaces';
5
4
  /**
6
5
  * Form is using for single manual bank account creation (not Basiq)
7
6
  */
@@ -1,5 +1,4 @@
1
1
  import { BankAccount as BankAccountBase } from '../../db/Models/bank/bank-account';
2
- import { BankAccountTypeEnum } from '../../db/Enums';
3
2
  import { Loan } from '../loan';
4
3
  import { BankAccountBalance } from '../../db/Models';
5
4
  import { BankAccountProperty } from './bank-account-property';
@@ -12,7 +11,6 @@ export declare class BankAccount extends BankAccountBase {
12
11
  balances: BankAccountBalance[];
13
12
  loan: Loan;
14
13
  bankConnection: BankConnection;
15
- type: BankAccountTypeEnum;
16
14
  get bank(): Bank;
17
15
  get bsb(): string;
18
16
  get number(): string;
@@ -4,7 +4,6 @@ export * from './bank';
4
4
  export * from './bank-account';
5
5
  export * from './bank-account-chart-data';
6
6
  export * from './bank-account-property';
7
- export * from './bank-account-types.const';
8
7
  export * from './bank-connection';
9
8
  export * from './bank-external-stats';
10
9
  export * from './bank-transaction';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @TODO refactor with Map
2
+ * @TODO refactor with Map or Record
3
3
  * List of objects grouped by passed property
4
4
  */
5
5
  export declare class Dictionary<Model> {
@@ -0,0 +1,13 @@
1
+ export declare const HTTP_ERROR_MESSAGES: {
2
+ 400: string;
3
+ 401: string;
4
+ 403: string;
5
+ 404: string;
6
+ 405: string;
7
+ 408: string;
8
+ 429: string;
9
+ 500: string;
10
+ 502: string;
11
+ 503: string;
12
+ 504: string;
13
+ };
@@ -1,3 +1,4 @@
1
1
  export * from './rest.service';
2
+ export * from './http-error-messages.const';
2
3
  export * from './rest-method.type';
3
4
  export * from './http-method.type';
@@ -44,6 +44,21 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
44
44
  protected orderByDesc: boolean;
45
45
  roles: UserRolesEnum[];
46
46
  mercureTopic: string;
47
+ /**
48
+ * flag to use error messages from api or default ones
49
+ * @TODO: TT-4642 check customHttpErrorMessages fix change to backend errors
50
+ */
51
+ protected useBackendError: boolean;
52
+ /**
53
+ * messages that can be redefined in other classes to customize httpErrorMessages
54
+ */
55
+ protected customHttpErrorMessages: {};
56
+ /**
57
+ * mapping with HTTP errors codes and general messages
58
+ */
59
+ protected httpErrorMessages: {
60
+ [key: number]: string;
61
+ };
47
62
  constructor(environment: any);
48
63
  protected get apiUrl(): string;
49
64
  setCache(data: any[], next?: boolean): void;
@@ -89,6 +104,13 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
89
104
  * Remove multiple Model instances from database
90
105
  */
91
106
  deleteBatch(models: Model[]): Observable<void>;
107
+ /**
108
+ * Handle response errors - shows error in toast
109
+ * and throws error further
110
+ * @param error - any backend error
111
+ * @throws HttpErrorResponse | Error - Always throws the error further as an Observable<never>
112
+ */
113
+ handleError(error: unknown): Observable<never>;
92
114
  /**
93
115
  * Handle response data - update cache and dispatch event if it is needed
94
116
  */
@@ -7,6 +7,9 @@ export declare class AllocationRuleService extends RestService<AllocationRuleBas
7
7
  protected endpointUri: string;
8
8
  collectionClass: typeof AllocationRuleCollection;
9
9
  modelClass: typeof AllocationRule;
10
+ customHttpErrorMessages: {
11
+ 422: string;
12
+ };
10
13
  static ɵfac: i0.ɵɵFactoryDeclaration<AllocationRuleService, never>;
11
14
  static ɵprov: i0.ɵɵInjectableDeclaration<AllocationRuleService>;
12
15
  }
@@ -0,0 +1,3 @@
1
+ export declare enum CorelogicMessagesEnum {
2
+ SERVICE_UNAVAILABLE = "Corelogic service is temporary unavailable, please try again in a few minutes."
3
+ }
@@ -1,13 +1,15 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Observable, ReplaySubject } from 'rxjs';
3
3
  import { CorelogicSuggestion } from '../../../models';
4
+ import { ToastService } from '../../toast';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class CorelogicService {
6
7
  private http;
8
+ private toastService;
7
9
  private environment;
8
10
  _accessToken: string;
9
11
  accessTokenSubject: ReplaySubject<string>;
10
- constructor(http: HttpClient, environment: any);
12
+ constructor(http: HttpClient, toastService: ToastService, environment: any);
11
13
  getAccessToken(force?: boolean): Observable<string>;
12
14
  getSuggestions(query: string, country?: string): Observable<CorelogicSuggestion[]>;
13
15
  static ɵfac: i0.ɵɵFactoryDeclaration<CorelogicService, never>;
@@ -1 +1,2 @@
1
1
  export * from './corelogic.service';
2
+ export * from './corelogic-messages.enum';
@@ -1,14 +0,0 @@
1
- import { BankAccountTypeEnum } from '../../db/Enums/bank/bank-account-type.enum';
2
- /**
3
- * Const which contains array of bank account types
4
- */
5
- export const BANK_ACCOUNT_TYPES = [
6
- { key: BankAccountTypeEnum.CREDIT_CARD, value: 'Credit Card Accounts' },
7
- { key: BankAccountTypeEnum.TERM_DEPOSIT, value: 'Deposit Accounts' },
8
- { key: BankAccountTypeEnum.INVESTMENT, value: 'Investment Accounts' },
9
- { key: BankAccountTypeEnum.LOAN, value: 'Loan Accounts' },
10
- { key: BankAccountTypeEnum.OFFSET, value: 'Offset' },
11
- { key: BankAccountTypeEnum.SAVINGS, value: 'Savings Accounts' },
12
- { key: BankAccountTypeEnum.TRANSACTION, value: 'Transaction Accounts' },
13
- ];
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFu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rL2JhbmstYWNjb3VudC10eXBlLmVudW0nO1xuXG4vKipcbiAqIENvbnN0IHdoaWNoIGNvbnRhaW5zIGFycmF5IG9mIGJhbmsgYWNjb3VudCB0eXBlc1xuICovXG5leHBvcnQgY29uc3QgQkFOS19BQ0NPVU5UX1RZUEVTOiB7a2V5OiBudW1iZXIsIHZhbHVlOiBzdHJpbmd9W10gPSBbXG4gIHtrZXk6IEJhbmtBY2NvdW50VHlwZUVudW0uQ1JFRElUX0NBUkQsIHZhbHVlOiAnQ3JlZGl0IENhcmQgQWNjb3VudHMnfSxcbiAge2tleTogQmFua0FjY291bnRUeXBlRW51bS5URVJNX0RFUE9TSVQsIHZhbHVlOiAnRGVwb3NpdCBBY2NvdW50cyd9LFxuICB7a2V5OiBCYW5rQWNjb3VudFR5cGVFbnVtLklOVkVTVE1FTlQsIHZhbHVlOiAnSW52ZXN0bWVudCBBY2NvdW50cyd9LFxuICB7a2V5OiBCYW5rQWNjb3VudFR5cGVFbnVtLkxPQU4sIHZhbHVlOiAnTG9hbiBBY2NvdW50cyd9LFxuICB7a2V5OiBCYW5rQWNjb3VudFR5cGVFbnVtLk9GRlNFVCwgdmFsdWU6ICdPZmZzZXQnfSxcbiAge2tleTogQmFua0FjY291bnRUeXBlRW51bS5TQVZJTkdTLCB2YWx1ZTogJ1NhdmluZ3MgQWNjb3VudHMnfSxcbiAge2tleTogQmFua0FjY291bnRUeXBlRW51bS5UUkFOU0FDVElPTiwgdmFsdWU6ICdUcmFuc2FjdGlvbiBBY2NvdW50cyd9LFxuXTtcbiJdfQ==
@@ -1,7 +0,0 @@
1
- /**
2
- * Const which contains array of bank account types
3
- */
4
- export declare const BANK_ACCOUNT_TYPES: {
5
- key: number;
6
- value: string;
7
- }[];