taxtank-core 0.21.17 → 0.22.0

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 (24) hide show
  1. package/bundles/taxtank-core.umd.js +100 -17
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/depreciation.collection.js +7 -2
  4. package/esm2015/lib/collections/property/property.collection.js +4 -1
  5. package/esm2015/lib/db/Models/property/property-share.js +1 -1
  6. package/esm2015/lib/models/event/app-event-type.enum.js +18 -16
  7. package/esm2015/lib/models/property/property.js +4 -1
  8. package/esm2015/lib/models/report/my-tax/my-tax-rent/my-tax-rent.js +2 -2
  9. package/esm2015/lib/services/http/property/property-sale/property-sale.service.js +21 -1
  10. package/esm2015/lib/services/http/property/property-share/property-share.service.js +23 -1
  11. package/esm2015/lib/services/http/property/property.service.js +24 -1
  12. package/esm2015/lib/services/http/rest/rest.service.js +4 -1
  13. package/fesm2015/taxtank-core.js +93 -17
  14. package/fesm2015/taxtank-core.js.map +1 -1
  15. package/lib/collections/depreciation.collection.d.ts +1 -0
  16. package/lib/collections/property/property.collection.d.ts +1 -0
  17. package/lib/db/Models/property/property-share.d.ts +2 -0
  18. package/lib/models/event/app-event-type.enum.d.ts +17 -15
  19. package/lib/models/property/property.d.ts +1 -0
  20. package/lib/services/http/property/property-sale/property-sale.service.d.ts +9 -0
  21. package/lib/services/http/property/property-share/property-share.service.d.ts +5 -0
  22. package/lib/services/http/property/property.service.d.ts +6 -0
  23. package/lib/services/http/rest/rest.service.d.ts +1 -0
  24. package/package.json +1 -1
@@ -10,6 +10,7 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
10
10
  */
11
11
  get amount(): number;
12
12
  get claimAmount(): number;
13
+ getClaimedAmountByYear(year?: number): number;
13
14
  getClaimAmountByYear(year?: number): number;
14
15
  getCloseBalanceByYear(year?: number): number;
15
16
  getCurrentYearForecastAmount(): number;
@@ -18,6 +18,7 @@ export declare class PropertyCollection extends Collection<Property> {
18
18
  * Get new property collection filtered by shared
19
19
  */
20
20
  getSharedProperties(): PropertyCollection;
21
+ getUnsold(): this;
21
22
  /**
22
23
  * Get total purchase price for all properties in the collection
23
24
  */
@@ -4,6 +4,7 @@ import { Property } from './property';
4
4
  import { User } from '../user/user';
5
5
  import { RegistrationInvite } from '../user/registration-invite';
6
6
  import { AbstractModel } from '../abstract-model';
7
+ import { PropertySale } from './property-sale/property-sale';
7
8
  export declare class PropertyShare extends AbstractModel {
8
9
  id?: number;
9
10
  email?: string;
@@ -18,4 +19,5 @@ export declare class PropertyShare extends AbstractModel {
18
19
  property?: Property;
19
20
  user?: User;
20
21
  invite?: RegistrationInvite;
22
+ sale?: PropertySale;
21
23
  }
@@ -29,19 +29,21 @@ export declare enum AppEventTypeEnum {
29
29
  PROPERTY_MOVEMENT_UPDATED = 27,
30
30
  PROPERTY_MOVEMENT_DELETED = 28,
31
31
  PROPERTY_SHARE_UPDATED = 29,
32
- PROPERTY_SUBSCRIPTION_ADDED = 30,
33
- PROPERTY_SUBSCRIPTION_DELETED = 31,
34
- PROPERTY_VALUATION_DOCUMENT_CREATED = 32,
35
- SERVICE_SUBSCRIPTION_UPDATED = 33,
36
- TAX_REVIEW_UPDATED = 34,
37
- TRANSACTION_CREATED = 35,
38
- TRANSACTION_DELETED = 36,
39
- TRANSACTION_UPDATED = 37,
40
- TRANSACTIONS_CREATED = 38,
41
- USER_UPDATED = 39,
42
- VEHICLE_CLAIM_UPDATED = 40,
43
- VEHICLE_CLAIM_CREATED = 41,
44
- VEHICLE_LOGBOOK_CREATED = 42,
45
- VEHICLE_LOGBOOK_UPDATED = 43,
46
- VEHICLE_LOGBOOK_DELETED = 44
32
+ PROPERTY_SALE_ADDED = 30,
33
+ PROPERTY_SALE_DELETED = 31,
34
+ PROPERTY_SUBSCRIPTION_ADDED = 32,
35
+ PROPERTY_SUBSCRIPTION_DELETED = 33,
36
+ PROPERTY_VALUATION_DOCUMENT_CREATED = 34,
37
+ SERVICE_SUBSCRIPTION_UPDATED = 35,
38
+ TAX_REVIEW_UPDATED = 36,
39
+ TRANSACTION_CREATED = 37,
40
+ TRANSACTION_DELETED = 38,
41
+ TRANSACTION_UPDATED = 39,
42
+ TRANSACTIONS_CREATED = 40,
43
+ USER_UPDATED = 41,
44
+ VEHICLE_CLAIM_UPDATED = 42,
45
+ VEHICLE_CLAIM_CREATED = 43,
46
+ VEHICLE_LOGBOOK_CREATED = 44,
47
+ VEHICLE_LOGBOOK_UPDATED = 45,
48
+ VEHICLE_LOGBOOK_DELETED = 46
47
49
  }
@@ -31,6 +31,7 @@ export declare class Property extends PropertyBase implements Photoable, Documen
31
31
  get name(): string;
32
32
  get isActive(): boolean;
33
33
  isOwn(): boolean;
34
+ isSold(): boolean;
34
35
  /**
35
36
  * Get initials of property. Required by Photoable interface
36
37
  */
@@ -1,10 +1,19 @@
1
1
  import { PropertySale as PropertySaleBase } from '../../../../db/Models/property/property-sale/property-sale';
2
2
  import { PropertySale } from '../../../../models/property/property-sale/property-sale';
3
3
  import { RestService } from '../../rest/rest.service';
4
+ import { Observable } from 'rxjs';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class PropertySaleService extends RestService<PropertySaleBase, PropertySale> {
6
7
  modelClass: typeof PropertySale;
7
8
  url: string;
9
+ /**
10
+ * @Todo should be extended from the RestService
11
+ */
12
+ add(model: PropertySale): Observable<PropertySale>;
13
+ /**
14
+ * @Todo should be extended from the RestService
15
+ */
16
+ delete(model: PropertySale): Observable<void>;
8
17
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertySaleService, never>;
9
18
  static ɵprov: i0.ɵɵInjectableDeclaration<PropertySaleService>;
10
19
  }
@@ -34,6 +34,11 @@ export declare class PropertyShareService extends RestService<PropertyShareBase,
34
34
  * Listen to User updated event
35
35
  */
36
36
  private listenUserUpdated;
37
+ /**
38
+ * @Todo Alex refactor after PropertyShare functionality in PropertyService will be cleared up
39
+ */
40
+ private listenSalesAdded;
41
+ private listenSalesDeleted;
37
42
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertyShareService, never>;
38
43
  static ɵprov: i0.ɵɵInjectableDeclaration<PropertyShareService>;
39
44
  }
@@ -5,6 +5,7 @@ import { Property } from '../../../models/property/property';
5
5
  import { IEventListener } from '../../../interfaces/event-listener.interface';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
+ * @Todo Alex remove functionality related to PropertyShare
8
9
  * Service for work with Property
9
10
  */
10
11
  export declare class PropertyService extends RestService<PropertyBase, Property> implements IEventListener {
@@ -19,6 +20,11 @@ export declare class PropertyService extends RestService<PropertyBase, Property>
19
20
  * Update cache when property category changed
20
21
  */
21
22
  private listenMovementsChanged;
23
+ /**
24
+ * @Todo Alex refactor after PropertyShare will be cleared up
25
+ */
26
+ private listenSalesAdded;
27
+ private listenSalesDeleted;
22
28
  update(property: Property): Observable<Property>;
23
29
  getByCategoryId(id: number): Observable<Property[]>;
24
30
  /**
@@ -38,6 +38,7 @@ export declare abstract class RestService<BaseModel, Model extends BaseModel> im
38
38
  * @param id ID of required item
39
39
  */
40
40
  findById(id: number): Observable<Model>;
41
+ find(id: number): Model;
41
42
  /**
42
43
  * add new instance and update cache
43
44
  * @TODO rename to post
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.21.17",
3
+ "version": "0.22.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",