law-common 11.0.1-beta.2 → 11.0.1-beta.4

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.
@@ -77,8 +77,9 @@ export declare class ClientEntityModel extends BaseEntityModel<EntityEnum.CLIENT
77
77
  get addressLineTwo(): string;
78
78
  get city(): string;
79
79
  get state(): string;
80
- get creditNoteTransactions(): import("./billing-transaction.model").BillingTransactionEntityModel[];
81
- get adjustedCreditNoteTransactions(): import("./billing-transaction.model").BillingTransactionEntityModel[];
80
+ getBillingsFromProfileCode(billingProfileCode?: string): import("./billing.entity.model").BillingEntityModel[];
81
+ getCreditNoteTransactions(billingProfileCode?: string): import("./billing-transaction.model").BillingTransactionEntityModel[];
82
+ getAdjustedCreditNoteTransactions(billingProfileCode?: string): import("./billing-transaction.model").BillingTransactionEntityModel[];
82
83
  get totalCreditNoteAmount(): number;
83
84
  get totalCreditNoteAmountAdjusted(): number;
84
85
  get totalCreditNoteAmountPendingForAdjustment(): number;
@@ -105,11 +105,14 @@ class ClientEntityModel extends base_entity_model_1.BaseEntityModel {
105
105
  var _a, _b;
106
106
  return (_b = (_a = this.parsedAddress) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : "";
107
107
  }
108
- get creditNoteTransactions() {
109
- return this.projects.flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; }).flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
108
+ getBillingsFromProfileCode(billingProfileCode) {
109
+ return this.projects.flatMap((project) => { var _a; return (_a = project.billings) !== null && _a !== void 0 ? _a : []; }).filter((billing) => billing.billingProfileCode === billingProfileCode);
110
110
  }
111
- get adjustedCreditNoteTransactions() {
112
- return this.projects.flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; }).flatMap((billing) => { var _a; return (_a = billing.adjustedCreditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
111
+ getCreditNoteTransactions(billingProfileCode) {
112
+ return this.getBillingsFromProfileCode(billingProfileCode).flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
113
+ }
114
+ getAdjustedCreditNoteTransactions(billingProfileCode) {
115
+ return this.getBillingsFromProfileCode(billingProfileCode).flatMap((billing) => { var _a; return (_a = billing.adjustedCreditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
113
116
  }
114
117
  get totalCreditNoteAmount() {
115
118
  const creditNoteTransactions = this.projects.flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; }).flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
package/dist/src/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
37
  };
@@ -149,12 +149,12 @@ export declare function getEnumNames(enumType: object): string[];
149
149
  export declare function getFilterByPermission<T extends EnumEntityType<EntityEnum>>(permissionFilterConfig: {
150
150
  [key: string]: IEntityFilterData<T>;
151
151
  }, propertyName: keyof T, userPermission: string, filterDto: IEntityFilterData<T>, emptyValue?: any): {
152
- [x: string]: any;
152
+ [propertyName]: any;
153
153
  };
154
154
  export declare function getFilterByPermissionFn<T extends EnumEntityType<EntityEnum>>(permissionFilterConfig: {
155
155
  [key: string]: () => Promise<IEntityFilterData<T>>;
156
156
  }, propertyName: keyof T, userPermission: string, filterDto: IEntityFilterData<T>, emptyValue?: any): Promise<{
157
- [x: string]: any;
157
+ [propertyName]: any;
158
158
  }>;
159
159
  export declare function getPropertyFilterByPermissionFn<T extends EnumEntityType<EntityEnum>>(permissionFilterConfig: {
160
160
  [key: string]: () => Promise<IEntityFilterData<T>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "11.0.1-beta.2",
3
+ "version": "11.0.1-beta.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [