taxtank-core 0.32.88 → 0.32.90

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 (119) hide show
  1. package/esm2022/lib/collections/client-movement.collection.mjs +5 -4
  2. package/esm2022/lib/collections/client.collection.mjs +1 -1
  3. package/esm2022/lib/collections/collection.mjs +5 -2
  4. package/esm2022/lib/collections/firm/employee-invite.collection.mjs +10 -0
  5. package/esm2022/lib/collections/firm/employee.collection.mjs +18 -0
  6. package/esm2022/lib/collections/firm/index.mjs +3 -0
  7. package/esm2022/lib/collections/income-source/income-source.collection.mjs +2 -2
  8. package/esm2022/lib/collections/index.mjs +3 -2
  9. package/esm2022/lib/collections/user/user.collection.mjs +4 -0
  10. package/esm2022/lib/db/Enums/firm/employee-invite-role.enum.mjs +6 -0
  11. package/esm2022/lib/db/Enums/firm/firm-type.enum.mjs +6 -0
  12. package/esm2022/lib/db/Enums/firm/index.mjs +3 -0
  13. package/esm2022/lib/db/Enums/index.mjs +2 -1
  14. package/esm2022/lib/db/Enums/user-roles.enum.mjs +2 -1
  15. package/esm2022/lib/db/Models/firm/client-invite.mjs +1 -1
  16. package/esm2022/lib/db/Models/firm/client-movement.mjs +1 -1
  17. package/esm2022/lib/db/Models/firm/employee-invite.mjs +1 -1
  18. package/esm2022/lib/db/Models/firm/firm.mjs +1 -1
  19. package/esm2022/lib/db/Models/user/employee-details.mjs +1 -1
  20. package/esm2022/lib/forms/abstract.form.mjs +7 -3
  21. package/esm2022/lib/forms/collection.form.mjs +29 -0
  22. package/esm2022/lib/forms/firm/client-invite-put.form.mjs +13 -0
  23. package/esm2022/lib/forms/firm/client-invite.form.mjs +17 -0
  24. package/esm2022/lib/forms/firm/client-movement.form.mjs +22 -0
  25. package/esm2022/lib/forms/firm/employee-details.form.mjs +21 -0
  26. package/esm2022/lib/forms/firm/employee-invite.form.mjs +23 -0
  27. package/esm2022/lib/forms/firm/firm-branch.form.mjs +13 -0
  28. package/esm2022/lib/forms/firm/index.mjs +7 -1
  29. package/esm2022/lib/forms/index.mjs +2 -1
  30. package/esm2022/lib/forms/register/register-firm.form.mjs +3 -3
  31. package/esm2022/lib/forms/sole/bas-report.form.mjs +2 -2
  32. package/esm2022/lib/forms/user/user.form.mjs +8 -8
  33. package/esm2022/lib/models/client/client-invite.mjs +12 -5
  34. package/esm2022/lib/models/client/client-movement.mjs +8 -5
  35. package/esm2022/lib/models/employee/employee-details.mjs +8 -2
  36. package/esm2022/lib/models/employee/employee-invite.mjs +9 -2
  37. package/esm2022/lib/models/endpoint/endpoints.const.mjs +17 -13
  38. package/esm2022/lib/models/firm/firm-branch.interface.mjs +2 -0
  39. package/esm2022/lib/models/firm/firm-branch.mjs +22 -0
  40. package/esm2022/lib/models/firm/firm.mjs +2 -2
  41. package/esm2022/lib/models/firm/index.mjs +3 -0
  42. package/esm2022/lib/models/index.mjs +2 -1
  43. package/esm2022/lib/models/registration-invite/registration-invite.mjs +5 -1
  44. package/esm2022/lib/models/user/user.mjs +5 -5
  45. package/esm2022/lib/services/account-setup/account-setup.service.mjs +2 -2
  46. package/esm2022/lib/services/firm/current-firm-branch.service.mjs +26 -0
  47. package/esm2022/lib/services/firm/index.mjs +2 -0
  48. package/esm2022/lib/services/http/firm/client-invite/client-invite.service.mjs +4 -7
  49. package/esm2022/lib/services/http/firm/client-movement/client-movement.service.mjs +1 -1
  50. package/esm2022/lib/services/http/firm/employee/employee-messages.enum.mjs +2 -1
  51. package/esm2022/lib/services/http/firm/employee/employee.service.mjs +10 -4
  52. package/esm2022/lib/services/http/firm/employee-invite/employee-invite.service.mjs +5 -5
  53. package/esm2022/lib/services/http/firm/firm-branch/firm-branch-messages.enum.mjs +9 -0
  54. package/esm2022/lib/services/http/firm/firm-branch/firm-branch.service.mjs +23 -0
  55. package/esm2022/lib/services/http/firm/firm-branch/index.mjs +3 -0
  56. package/esm2022/lib/services/http/firm/firm.service.mjs +2 -2
  57. package/esm2022/lib/services/http/firm/index.mjs +2 -1
  58. package/esm2022/lib/services/index.mjs +2 -1
  59. package/esm2022/public-api.mjs +1 -2
  60. package/fesm2022/taxtank-core.mjs +304 -60
  61. package/fesm2022/taxtank-core.mjs.map +1 -1
  62. package/lib/collections/client-movement.collection.d.ts +2 -2
  63. package/lib/collections/client.collection.d.ts +1 -1
  64. package/lib/collections/firm/employee-invite.collection.d.ts +5 -0
  65. package/lib/collections/firm/employee.collection.d.ts +6 -0
  66. package/lib/collections/firm/index.d.ts +2 -0
  67. package/lib/collections/income-source/income-source.collection.d.ts +1 -1
  68. package/lib/collections/index.d.ts +2 -1
  69. package/lib/collections/user/user.collection.d.ts +4 -0
  70. package/lib/db/Enums/firm/employee-invite-role.enum.d.ts +4 -0
  71. package/lib/db/Enums/firm/index.d.ts +2 -0
  72. package/lib/db/Enums/index.d.ts +1 -0
  73. package/lib/db/Enums/user-roles.enum.d.ts +1 -0
  74. package/lib/db/Models/firm/client-invite.d.ts +6 -2
  75. package/lib/db/Models/firm/client-movement.d.ts +2 -2
  76. package/lib/db/Models/firm/employee-invite.d.ts +4 -2
  77. package/lib/db/Models/firm/firm.d.ts +1 -1
  78. package/lib/db/Models/user/employee-details.d.ts +2 -0
  79. package/lib/forms/abstract.form.d.ts +14 -7
  80. package/lib/forms/collection.form.d.ts +14 -0
  81. package/lib/forms/firm/client-invite-put.form.d.ts +11 -0
  82. package/lib/forms/firm/client-invite.form.d.ts +15 -0
  83. package/lib/forms/firm/client-movement.form.d.ts +14 -0
  84. package/lib/forms/firm/employee-details.form.d.ts +14 -0
  85. package/lib/forms/firm/employee-invite.form.d.ts +17 -0
  86. package/lib/forms/firm/firm-branch.form.d.ts +5 -0
  87. package/lib/forms/firm/index.d.ts +6 -0
  88. package/lib/forms/index.d.ts +1 -0
  89. package/lib/forms/register/register-firm.form.d.ts +2 -2
  90. package/lib/forms/user/user.form.d.ts +15 -3
  91. package/lib/models/client/client-invite.d.ts +5 -2
  92. package/lib/models/client/client-movement.d.ts +3 -2
  93. package/lib/models/employee/employee-details.d.ts +3 -1
  94. package/lib/models/employee/employee-invite.d.ts +4 -1
  95. package/lib/models/firm/firm-branch.d.ts +12 -0
  96. package/lib/models/firm/firm-branch.interface.d.ts +7 -0
  97. package/lib/models/firm/index.d.ts +2 -0
  98. package/lib/models/index.d.ts +1 -0
  99. package/lib/models/registration-invite/registration-invite.d.ts +2 -0
  100. package/lib/models/user/user.d.ts +1 -3
  101. package/lib/services/firm/current-firm-branch.service.d.ts +11 -0
  102. package/lib/services/firm/index.d.ts +1 -0
  103. package/lib/services/http/firm/client-invite/client-invite.service.d.ts +0 -1
  104. package/lib/services/http/firm/client-movement/client-movement.service.d.ts +1 -1
  105. package/lib/services/http/firm/employee/employee-messages.enum.d.ts +2 -1
  106. package/lib/services/http/firm/employee/employee.service.d.ts +4 -3
  107. package/lib/services/http/firm/employee-invite/employee-invite.service.d.ts +3 -3
  108. package/lib/services/http/firm/firm-branch/firm-branch-messages.enum.d.ts +7 -0
  109. package/lib/services/http/firm/firm-branch/firm-branch.service.d.ts +13 -0
  110. package/lib/services/http/firm/firm-branch/index.d.ts +2 -0
  111. package/lib/services/http/firm/firm.service.d.ts +2 -2
  112. package/lib/services/http/firm/index.d.ts +1 -0
  113. package/lib/services/index.d.ts +1 -0
  114. package/package.json +1 -1
  115. package/public-api.d.ts +0 -1
  116. package/esm2022/lib/collections/employee.collection.mjs +0 -11
  117. package/esm2022/lib/db/Enums/firm-type.enum.mjs +0 -6
  118. package/lib/collections/employee.collection.d.ts +0 -6
  119. /package/lib/db/Enums/{firm-type.enum.d.ts → firm/firm-type.enum.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { Collection } from './collection';
2
2
  import { ClientMovement } from '../models';
3
- import { EmployeeCollection } from './employee.collection';
3
+ import { EmployeeCollection } from './firm';
4
4
  import { ClientCollection } from './client.collection';
5
- import { FirmTypeEnum } from '../db/Enums/firm-type.enum';
5
+ import { FirmTypeEnum } from '../db/Enums';
6
6
  import { CollectionDictionary } from './collection-dictionary';
7
7
  /**
8
8
  * Collection of tax review
@@ -1,4 +1,4 @@
1
1
  import { Collection } from './collection';
2
- import { User } from '../models/user/user';
2
+ import { User } from '../models';
3
3
  export declare class ClientCollection extends Collection<User> {
4
4
  }
@@ -0,0 +1,5 @@
1
+ import { Collection } from '../collection';
2
+ import { EmployeeInvite } from '../../models/employee/employee-invite';
3
+ export declare class EmployeeInviteCollection extends Collection<EmployeeInvite> {
4
+ filterByBranchIds(firmBranchIds: number[]): this;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { UserCollection } from '../user/user.collection';
2
+ import { CollectionDictionary } from '../collection-dictionary';
3
+ export declare class EmployeeCollection extends UserCollection {
4
+ groupByBranch(): CollectionDictionary<EmployeeCollection>;
5
+ filterByBranchIds(firmBranchIds: number[]): this;
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from './employee.collection';
2
+ export * from './employee-invite.collection';
@@ -9,7 +9,7 @@ import { IIncomeSourceForecast } from '../../interfaces';
9
9
  export declare class IncomeSourceCollection extends Collection<IncomeSource> {
10
10
  filterByTank(tank: TankTypeEnum): IncomeSource[];
11
11
  /**
12
- * Filter income sources by provided tyoes
12
+ * Filter income sources by provided types
13
13
  * @param types
14
14
  */
15
15
  filterByTypes(types: IncomeSourceTypeEnum[]): IncomeSource[];
@@ -21,7 +21,7 @@ export * from './client-portfolio-report.collection';
21
21
  export * from './client.collection';
22
22
  export * from './depreciation-forecast.collection';
23
23
  export * from './depreciation.collection';
24
- export * from './employee.collection';
24
+ export * from './firm';
25
25
  export * from './exportable.collection';
26
26
  export * from './income-source';
27
27
  export * from './tax-review.collection';
@@ -29,3 +29,4 @@ export * from './user-event-setting.collection';
29
29
  export * from './user-event-type-collection';
30
30
  export * from './holding';
31
31
  export * from './asset-sale.collection';
32
+ export * from './user/user.collection';
@@ -0,0 +1,4 @@
1
+ import { User } from '../../models';
2
+ import { Collection } from '../collection';
3
+ export declare class UserCollection extends Collection<User> {
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum EmployeeInviteRoleEnum {
2
+ EMPLOYEE = 1,
3
+ MANAGER = 2
4
+ }
@@ -0,0 +1,2 @@
1
+ export * from './employee-invite-role.enum';
2
+ export * from './firm-type.enum';
@@ -3,6 +3,7 @@ export * from './allocation-rule-condition-field.enum';
3
3
  export * from './allocation-rule-condition-operator.enum';
4
4
  export * from './allocation-rule-type.enum';
5
5
  export * from './bank';
6
+ export * from './firm';
6
7
  export * from './annual-frequency.enum';
7
8
  export * from './chart-accounts';
8
9
  export * from './document-type.enum';
@@ -1,6 +1,7 @@
1
1
  export declare enum UserRolesEnum {
2
2
  FIRM_OWNER = "ROLE_FIRM_OWNER",
3
3
  FIRM_MANAGER = "ROLE_FIRM_MANAGER",
4
+ FIRM_TOP_MANAGER = "ROLE_FIRM_TOP_MANAGER",
4
5
  CLIENT = "ROLE_CLIENT",
5
6
  EMPLOYEE = "ROLE_EMPLOYEE",
6
7
  ACCOUNTANT = "ROLE_ACCOUNTANT",
@@ -1,9 +1,11 @@
1
1
  import { ClientInviteTypeEnum } from '../../Enums/client-invite-type.enum';
2
2
  import { ClientInviteStatusEnum } from '../../Enums/client-invite-status.enum';
3
3
  import { User } from '../user/user';
4
- import { Firm } from './firm';
5
4
  import { RegistrationInvite } from '../user/registration-invite';
6
5
  import { ObservableModel } from '../observable-model';
6
+ import { FirmBranchInterface } from '../../../models/firm/firm-branch.interface';
7
+ import { Firm } from './firm';
8
+ import { Address } from '../address';
7
9
  export declare class ClientInvite extends ObservableModel {
8
10
  static className: string;
9
11
  type?: ClientInviteTypeEnum;
@@ -12,6 +14,8 @@ export declare class ClientInvite extends ObservableModel {
12
14
  updatedAt?: Date;
13
15
  employee?: User;
14
16
  client?: User;
15
- firm?: Firm;
16
17
  registrationInvite?: RegistrationInvite;
18
+ address?: Address;
19
+ firm?: Firm;
20
+ firmBranch?: FirmBranchInterface;
17
21
  }
@@ -1,11 +1,11 @@
1
- import { Firm } from './firm';
2
1
  import { User } from '../user/user';
3
2
  import { ObservableModel } from '../observable-model';
3
+ import { FirmBranch } from '../../../models';
4
4
  export declare class ClientMovement extends ObservableModel {
5
5
  static className: string;
6
6
  dateFrom?: Date;
7
7
  dateTo?: Date;
8
- firm?: Firm;
9
8
  client?: User;
10
9
  employee?: User;
10
+ firmBranch?: FirmBranch;
11
11
  }
@@ -1,9 +1,11 @@
1
1
  import { User } from '../user/user';
2
- import { Firm } from './firm';
3
2
  import { RegistrationInvite } from '../user/registration-invite';
4
3
  import { AbstractModel } from '../abstract-model';
4
+ import { FirmBranch } from '../../../models';
5
+ import { EmployeeInviteRoleEnum } from '../../Enums';
5
6
  export declare class EmployeeInvite extends AbstractModel {
6
7
  employee?: User;
7
- firm?: Firm;
8
8
  registrationInvite?: RegistrationInvite;
9
+ firmBranches?: FirmBranch[];
10
+ role?: EmployeeInviteRoleEnum;
9
11
  }
@@ -1,4 +1,4 @@
1
- import { FirmTypeEnum } from '../../Enums/firm-type.enum';
1
+ import { FirmTypeEnum } from '../../Enums';
2
2
  import { Address } from '../address';
3
3
  import { Phone } from '../phone';
4
4
  import { User } from '../user/user';
@@ -1,7 +1,9 @@
1
1
  import { User } from './user';
2
2
  import { Firm } from '../firm/firm';
3
3
  import { AbstractModel } from '../abstract-model';
4
+ import { FirmBranchInterface } from '../../../models/firm/firm-branch.interface';
4
5
  export declare class EmployeeDetails extends AbstractModel {
5
6
  user?: User;
6
7
  firm?: Firm;
8
+ firmBranches: FirmBranchInterface[];
7
9
  }
@@ -1,16 +1,24 @@
1
- import { AbstractControl, AbstractControlOptions, AsyncValidatorFn, UntypedFormGroup, ValidatorFn } from '@angular/forms';
1
+ import { AbstractControl, AbstractControlOptions, AsyncValidatorFn, FormGroup, ValidatorFn } from '@angular/forms';
2
2
  import { EventEmitter, Type } from '@angular/core';
3
+ /**
4
+ * Default Controls Interface with loose typing
5
+ */
6
+ export interface ControlsInterface {
7
+ [key: string]: AbstractControl<any, any>;
8
+ }
3
9
  /**
4
10
  * Abstract form class
5
11
  * @TODO rename to AbstractFormGroup
6
12
  * @TODO Alex TT-2190: refactor: check and improve logic
13
+ * @TODO Model extends AbstractModel
7
14
  */
8
- export declare abstract class AbstractForm<Model> extends UntypedFormGroup {
15
+ export declare abstract class AbstractForm<Model, Controls extends ControlsInterface = ControlsInterface> extends FormGroup<Controls> {
9
16
  static inputMaxLength: number;
10
17
  /**
11
18
  * Initial form value for comparison with changes to check saved/unsaved state
19
+ * @TODO typehint to model interface when all db/models migrated to interfaces
12
20
  */
13
- initialValue: Model;
21
+ initialValue: any;
14
22
  protected excludeExtraneousValues: boolean;
15
23
  protected modelClass: Type<Model>;
16
24
  model: Model;
@@ -21,11 +29,10 @@ export declare abstract class AbstractForm<Model> extends UntypedFormGroup {
21
29
  */
22
30
  unsaved: boolean;
23
31
  onSubmit: EventEmitter<Model>;
24
- protected constructor(controls: {
25
- [key: string]: AbstractControl;
26
- }, model?: Model, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null);
32
+ protected constructor(controls: Controls, model?: Model, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null);
27
33
  get saved(): boolean;
28
34
  get currentValue(): Model;
35
+ toggleEnabledState(): void;
29
36
  /**
30
37
  * Check validation and return a new instance of generic model.
31
38
  * Merge form value to initial object
@@ -33,7 +40,7 @@ export declare abstract class AbstractForm<Model> extends UntypedFormGroup {
33
40
  * @param includeDisabledFields ignore disabled fields
34
41
  */
35
42
  submit(data?: object, includeDisabledFields?: boolean): Model;
36
- addControl(name: string, control: AbstractControl, options?: {
43
+ addControl(name: string, control: Controls[string], options?: {
37
44
  emitEvent?: boolean;
38
45
  }): this;
39
46
  markAsUnsaved(): void;
@@ -0,0 +1,14 @@
1
+ import { FormArray } from '@angular/forms';
2
+ import { AbstractForm } from './';
3
+ import { AbstractModel } from '../db/Models';
4
+ export declare class CollectionForm<Form extends AbstractForm<Model>, Model extends AbstractModel> extends FormArray<Form> {
5
+ private formConstructor;
6
+ private args;
7
+ constructor(formConstructor: new (model?: Model, ...args: any[]) => Form, models?: Model[], ...args: any[]);
8
+ createFormGroup(model?: Model): Form;
9
+ add(model?: Model): void;
10
+ /**
11
+ * Submit form and return array of properties from form value
12
+ */
13
+ submit(data?: object, includeDisabledFields?: boolean): Model[];
14
+ }
@@ -0,0 +1,11 @@
1
+ import { FormControl } from '@angular/forms';
2
+ import { AbstractForm, ControlsInterface } from '../abstract.form';
3
+ import { ClientInvite, FirmBranch, User } from '../../models';
4
+ interface ClientInvitePutControlsInterface extends ControlsInterface {
5
+ employee: FormControl<User>;
6
+ firmBranch: FormControl<FirmBranch>;
7
+ }
8
+ export declare class ClientInvitePutForm extends AbstractForm<ClientInvite, ClientInvitePutControlsInterface> {
9
+ constructor(invite?: ClientInvite);
10
+ }
11
+ export {};
@@ -0,0 +1,15 @@
1
+ import { FormControl, FormGroup } from '@angular/forms';
2
+ import { AbstractForm, ControlsInterface } from '../abstract.form';
3
+ import { ClientInvite, User } from '../../models';
4
+ interface ClientInviteControlsInterface extends ControlsInterface {
5
+ employee: FormControl<User>;
6
+ registrationInvite: FormGroup<{
7
+ firstName: FormControl<string>;
8
+ lastName: FormControl<string>;
9
+ email: FormControl<string>;
10
+ }>;
11
+ }
12
+ export declare class ClientInviteForm extends AbstractForm<ClientInvite, ClientInviteControlsInterface> {
13
+ constructor(invite?: ClientInvite);
14
+ }
15
+ export {};
@@ -0,0 +1,14 @@
1
+ import { FormControl } from '@angular/forms';
2
+ import { AbstractForm, ControlsInterface } from '../abstract.form';
3
+ import { ClientMovement, FirmBranch, User } from '../../models';
4
+ import * as i0 from "@angular/core";
5
+ interface ClientMovementControlsInterface extends ControlsInterface {
6
+ employee: FormControl<User>;
7
+ firmBranch: FormControl<FirmBranch>;
8
+ }
9
+ export declare class ClientMovementForm extends AbstractForm<ClientMovement, ClientMovementControlsInterface> {
10
+ constructor(clientMovement: ClientMovement);
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClientMovementForm, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClientMovementForm>;
13
+ }
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import { FormControl } from '@angular/forms';
2
+ import { AbstractForm, ControlsInterface } from '../abstract.form';
3
+ import { FirmBranch } from '../../models';
4
+ import { EmployeeDetails } from '../../models/employee/employee-details';
5
+ import * as i0 from "@angular/core";
6
+ interface EmployeeDetailsControlsInterface extends ControlsInterface {
7
+ firmBranches: FormControl<FirmBranch[]>;
8
+ }
9
+ export declare class EmployeeDetailsForm extends AbstractForm<EmployeeDetails, EmployeeDetailsControlsInterface> {
10
+ constructor(employeeDetails: EmployeeDetails);
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmployeeDetailsForm, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<EmployeeDetailsForm>;
13
+ }
14
+ export {};
@@ -0,0 +1,17 @@
1
+ import { FormControl, FormGroup } from '@angular/forms';
2
+ import { AbstractForm, ControlsInterface } from '../abstract.form';
3
+ import { EmployeeInvite } from '../../models/employee/employee-invite';
4
+ import { UniqueEmailValidator } from '../../validators';
5
+ import { EmployeeInviteRoleEnum } from '../../db/Enums';
6
+ interface EmployeeInviteControlsInterface extends ControlsInterface {
7
+ registrationInvite: FormGroup<{
8
+ firstName: FormControl<string>;
9
+ lastName: FormControl<string>;
10
+ email: FormControl<string>;
11
+ }>;
12
+ role: FormControl<EmployeeInviteRoleEnum>;
13
+ }
14
+ export declare class EmployeeInviteForm extends AbstractForm<EmployeeInvite, EmployeeInviteControlsInterface> {
15
+ constructor(invite?: EmployeeInvite, uniqueEmailValidator?: UniqueEmailValidator);
16
+ }
17
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FirmBranch } from '../../models';
2
+ import { AbstractForm } from '../abstract.form';
3
+ export declare class FirmBranchForm extends AbstractForm<FirmBranch> {
4
+ constructor(firm: FirmBranch);
5
+ }
@@ -1 +1,7 @@
1
1
  export * from './firm.form';
2
+ export * from './firm-branch.form';
3
+ export * from './employee-invite.form';
4
+ export * from './client-movement.form';
5
+ export * from './employee-details.form';
6
+ export * from './client-invite.form';
7
+ export * from './client-invite-put.form';
@@ -1,4 +1,5 @@
1
1
  export * from './abstract.form';
2
+ export * from './collection.form';
2
3
  export * from './address';
3
4
  export * from './budget';
4
5
  export * from './document-folder';
@@ -1,6 +1,6 @@
1
1
  import { AbstractForm } from '../abstract.form';
2
- import { FirmTypeEnum } from '../../db/Enums/firm-type.enum';
3
- import { Firm } from '../../models/firm/firm';
2
+ import { FirmTypeEnum } from '../../db/Enums';
3
+ import { Firm } from '../../models';
4
4
  export declare class RegisterFirmForm extends AbstractForm<Firm> {
5
5
  private firmType;
6
6
  constructor(firmType: FirmTypeEnum, referenceCode?: string);
@@ -1,5 +1,17 @@
1
- import { User } from '../../models';
2
- import { AbstractForm } from '../abstract.form';
3
- export declare class UserForm extends AbstractForm<User> {
1
+ import { FormControl } from '@angular/forms';
2
+ import { Address, AppFile, User } from '../../models';
3
+ import { AbstractForm, ControlsInterface } from '../abstract.form';
4
+ import { UserTitleEnum } from '../../db/Enums/user-title.enum';
5
+ import { Phone } from '../../models/phone/phone';
6
+ interface UserControlsInterface extends ControlsInterface {
7
+ title: FormControl<UserTitleEnum>;
8
+ firstName: FormControl<string>;
9
+ lastName: FormControl<string>;
10
+ address: FormControl<Address>;
11
+ phone: FormControl<Phone>;
12
+ file: FormControl<AppFile>;
13
+ }
14
+ export declare class UserForm extends AbstractForm<User, UserControlsInterface> {
4
15
  constructor(user: User);
5
16
  }
17
+ export {};
@@ -1,14 +1,17 @@
1
1
  import { ClientInvite as ClientInviteBase } from '../../db/Models/firm/client-invite';
2
2
  import { RegistrationInvite } from '../registration-invite/registration-invite';
3
- import { Firm } from '../firm/firm';
4
3
  import { User } from '../user';
4
+ import { Firm, FirmBranch } from '../firm';
5
+ import { Address } from '../address';
5
6
  export declare class ClientInvite extends ClientInviteBase {
6
7
  sentOn: Date;
7
8
  updatedAt: Date;
8
- firm: Firm;
9
9
  client: User;
10
10
  employee: User;
11
11
  registrationInvite: RegistrationInvite;
12
+ address: Address;
13
+ firm: Firm;
14
+ firmBranch: FirmBranch;
12
15
  /**
13
16
  * Check if client invite status is pending
14
17
  */
@@ -1,10 +1,11 @@
1
1
  import { ClientMovement as ClientMovementBase } from '../../db/Models/firm/client-movement';
2
- import { Firm } from '../firm/firm';
2
+ import { Firm, FirmBranch } from '../firm';
3
3
  import { User } from '../user';
4
4
  export declare class ClientMovement extends ClientMovementBase {
5
- firm: Firm;
6
5
  client: User;
7
6
  employee: User;
8
7
  dateFrom: Date;
9
8
  dateTo: Date;
9
+ firmBranch?: FirmBranch;
10
+ get firm(): Firm;
10
11
  }
@@ -1,5 +1,7 @@
1
1
  import { EmployeeDetails as EmployeeDetailsBase } from '../../db/Models/user/employee-details';
2
- import { Firm } from '../firm/firm';
2
+ import { Firm, FirmBranch } from '../firm';
3
3
  export declare class EmployeeDetails extends EmployeeDetailsBase {
4
4
  firm: Firm;
5
+ firmBranches: FirmBranch[];
6
+ get firmBranchNames(): string;
5
7
  }
@@ -1,7 +1,10 @@
1
1
  import { EmployeeInvite as EmployeeInviteBase } from '../../db/Models/firm/employee-invite';
2
2
  import { RegistrationInvite } from '../registration-invite/registration-invite';
3
- import { User } from '../user/user';
3
+ import { User } from '../user';
4
+ import { FirmBranch } from '../firm';
4
5
  export declare class EmployeeInvite extends EmployeeInviteBase {
5
6
  registrationInvite: RegistrationInvite;
6
7
  employee: User;
8
+ firmBranches?: FirmBranch[];
9
+ get firmBranchNames(): string;
7
10
  }
@@ -0,0 +1,12 @@
1
+ import { Firm } from './firm';
2
+ import { Address } from '../address';
3
+ import { AbstractModel } from '../../db/Models';
4
+ import { FirmBranchInterface } from './firm-branch.interface';
5
+ import { Phone } from '../phone/phone';
6
+ export declare class FirmBranch extends AbstractModel implements FirmBranchInterface {
7
+ name: string;
8
+ isMain: boolean;
9
+ firm: Firm;
10
+ address: Address;
11
+ phone?: Phone;
12
+ }
@@ -0,0 +1,7 @@
1
+ export interface FirmBranchInterface {
2
+ name: string;
3
+ isMain: boolean;
4
+ firm: object;
5
+ address: object;
6
+ phone?: object;
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './firm';
2
+ export * from './firm-branch';
@@ -23,3 +23,4 @@ export * from './income-source';
23
23
  export * from './asset-sale';
24
24
  export * from './budget';
25
25
  export * from './tax-return';
26
+ export * from './firm';
@@ -1,6 +1,8 @@
1
1
  import { RegistrationInvite as RegistrationInviteBase } from '../../db/Models/user/registration-invite';
2
2
  import { AppFile } from '../file';
3
+ import { User } from '../user';
3
4
  export declare class RegistrationInvite extends RegistrationInviteBase {
4
5
  file: AppFile;
6
+ user: User;
5
7
  get fullName(): string;
6
8
  }
@@ -46,9 +46,7 @@ export declare class User extends BaseUser {
46
46
  * Check if current user is firm owner
47
47
  */
48
48
  isFirmOwner(): boolean;
49
- /**
50
- * Check if current user is firm manager
51
- */
49
+ isTopManager(): boolean;
52
50
  isManager(): boolean;
53
51
  /**
54
52
  * check if user has property tank access
@@ -0,0 +1,11 @@
1
+ import { BehaviorSubject, Observable } from 'rxjs';
2
+ import { FirmBranch } from '../../models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CurrentFirmBranchService {
5
+ firmBranchIds$: BehaviorSubject<number[]>;
6
+ get(): Observable<number[]>;
7
+ getCache(): number[];
8
+ set(firmBranches: FirmBranch[]): void;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<CurrentFirmBranchService, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<CurrentFirmBranchService>;
11
+ }
@@ -0,0 +1 @@
1
+ export * from './current-firm-branch.service';
@@ -13,7 +13,6 @@ export declare class ClientInviteService extends RestService<ClientInviteBase, C
13
13
  mercureTopic: string;
14
14
  constructor(environment: any);
15
15
  listenEvents(): void;
16
- getFirmInvites(): Observable<ClientInviteCollection>;
17
16
  /**
18
17
  * Get invite which employee is TaxTank Advisor
19
18
  * @TODO move to collection? but we need to inject enviroment
@@ -1,7 +1,7 @@
1
1
  import { ClientMovement as ClientMovementBase } from '../../../../db/Models/firm/client-movement';
2
2
  import { Observable } from 'rxjs';
3
3
  import { ClientMovementCollection } from '../../../../collections';
4
- import { FirmTypeEnum } from '../../../../db/Enums/firm-type.enum';
4
+ import { FirmTypeEnum } from '../../../../db/Enums';
5
5
  import { RestService } from '../../rest';
6
6
  import { ClientMovement } from '../../../../models';
7
7
  import { IEventListener } from '../../../../interfaces';
@@ -7,5 +7,6 @@ export declare enum EmployeeMessagesEnum {
7
7
  CONFIRM_ACTIVATE = "Are you sure you want to activate the employee account?",
8
8
  ACTIVATED = "Employee account activated",
9
9
  DEACTIVATED = "Employee account deactivated",
10
- DEACTIVATE_ERROR = "All clients must be transferred prior to removing an accountant"
10
+ DEACTIVATE_ERROR = "All clients must be transferred prior to removing an accountant",
11
+ UPDATED = "Employee account updated"
11
12
  }
@@ -3,18 +3,19 @@ import { User as UserBase } from '../../../../db/Models/user/user';
3
3
  import { Observable } from 'rxjs';
4
4
  import { User } from '../../../../models';
5
5
  import { EmployeeMessagesEnum } from './employee-messages.enum';
6
- import { Collection } from '../../../../collections';
6
+ import { EmployeeCollection } from '../../../../collections';
7
7
  import { UserRolesEnum } from '../../../../db/Enums/user-roles.enum';
8
8
  import * as i0 from "@angular/core";
9
- export declare class EmployeeService extends RestService<UserBase, User, Collection<User>> {
9
+ export declare class EmployeeService extends RestService<UserBase, User, EmployeeCollection> {
10
10
  protected endpointUri: string;
11
11
  modelClass: typeof User;
12
- collectionClass: typeof Collection<User>;
12
+ collectionClass: typeof EmployeeCollection;
13
13
  disabledMethods: RestMethod[];
14
14
  messages: typeof EmployeeMessagesEnum;
15
15
  roles: UserRolesEnum[];
16
16
  activateEmployee(employee: User): Observable<User>;
17
17
  deactivateEmployee(employee: User): Observable<User>;
18
+ toggleManagerRole(employee: User): Observable<User>;
18
19
  static ɵfac: i0.ɵɵFactoryDeclaration<EmployeeService, never>;
19
20
  static ɵprov: i0.ɵɵInjectableDeclaration<EmployeeService>;
20
21
  }
@@ -3,11 +3,11 @@ import { Observable } from 'rxjs';
3
3
  import { EmployeeInvite } from '../../../../models/employee/employee-invite';
4
4
  import { RestService } from '../../rest';
5
5
  import { UserRolesEnum } from '../../../../db/Enums/user-roles.enum';
6
- import { Collection } from '../../../../collections';
6
+ import { EmployeeInviteCollection } from '../../../../collections';
7
7
  import * as i0 from "@angular/core";
8
- export declare class EmployeeInviteService extends RestService<EmployeeInviteBase, EmployeeInvite, Collection<EmployeeInvite>> {
8
+ export declare class EmployeeInviteService extends RestService<EmployeeInviteBase, EmployeeInvite, EmployeeInviteCollection> {
9
9
  protected endpointUri: string;
10
- collectionClass: typeof Collection<EmployeeInvite>;
10
+ collectionClass: typeof EmployeeInviteCollection;
11
11
  modelClass: typeof EmployeeInvite;
12
12
  roles: UserRolesEnum[];
13
13
  /**
@@ -0,0 +1,7 @@
1
+ export declare enum FirmBranchMessagesEnum {
2
+ CREATED = "Branch created",
3
+ UPDATED = "Branch updated",
4
+ DELETED = "Branch deleted",
5
+ DELETE_ERROR = "Only empty branch can be deleted",
6
+ CONFIRM_DELETE = "Are you sure you want to delete this branch?"
7
+ }
@@ -0,0 +1,13 @@
1
+ import { RestMethod, RestService } from '../../rest';
2
+ import { Collection } from '../../../../collections';
3
+ import { FirmBranch } from '../../../../models';
4
+ import { FirmBranchInterface } from '../../../../models/firm/firm-branch.interface';
5
+ import * as i0 from "@angular/core";
6
+ export declare class FirmBranchService extends RestService<FirmBranchInterface, FirmBranch, Collection<FirmBranch>> {
7
+ protected endpointUri: string;
8
+ modelClass: typeof FirmBranch;
9
+ collectionClass: typeof Collection<FirmBranch>;
10
+ disabledMethods: RestMethod[];
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<FirmBranchService, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<FirmBranchService>;
13
+ }
@@ -0,0 +1,2 @@
1
+ export * from './firm-branch.service';
2
+ export * from './firm-branch-messages.enum';
@@ -1,7 +1,7 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Observable, ReplaySubject } from 'rxjs';
3
- import { FirmTypeEnum } from '../../../db/Enums/firm-type.enum';
4
- import { Firm } from '../../../models/firm/firm';
3
+ import { FirmTypeEnum } from '../../../db/Enums';
4
+ import { Firm } from '../../../models';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class FirmService {
7
7
  private http;
@@ -5,3 +5,4 @@ export * from './employee-invite';
5
5
  export * from './portfolio-report';
6
6
  export * from './firm-messages.enum';
7
7
  export * from './firm.service';
8
+ export * from './firm-branch';
@@ -15,4 +15,5 @@ export * from './property';
15
15
  export * from './report';
16
16
  export * from './toast';
17
17
  export * from './user';
18
+ export * from './firm';
18
19
  export * from './xlsx';