law-common 10.19.1-beta.4 → 10.19.1-beta.6

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.
@@ -100,3 +100,4 @@ export * from "./model/billing-timesheet.entity.model";
100
100
  export * from "./enums/billing-transaction-action.enum";
101
101
  export * from "./enums/billing-transaction-status.enum";
102
102
  export * from "./interface/billing-transaction-history.entity";
103
+ export * from "./model/billing-transaction.model";
@@ -117,3 +117,4 @@ __exportStar(require("./model/billing-timesheet.entity.model"), exports);
117
117
  __exportStar(require("./enums/billing-transaction-action.enum"), exports);
118
118
  __exportStar(require("./enums/billing-transaction-status.enum"), exports);
119
119
  __exportStar(require("./interface/billing-transaction-history.entity"), exports);
120
+ __exportStar(require("./model/billing-transaction.model"), exports);
@@ -6,6 +6,7 @@ import { HistoryOperationEnum } from "../enums/history_operation.enum";
6
6
  import { BankEntityModel } from "../model/bank.entity.model";
7
7
  import { BillingReimbursementExpneseEntityModel } from "../model/billing-reimbursement-expense.entity.model";
8
8
  import { BillingTimesheetEntityModel } from "../model/billing-timesheet.entity.model";
9
+ import { BillingTransactionEntityModel } from "../model/billing-transaction.model";
9
10
  import { BillingEntityModel } from "../model/billing.entity.model";
10
11
  import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
11
12
  import { ClientEntityModel } from "../model/client.entity.model";
@@ -283,7 +284,7 @@ export declare enum VirtualEntityEnum {
283
284
  }
284
285
  export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
285
286
  export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
286
- export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : UserEntityModel;
287
+ export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : UserEntityModel;
287
288
  export type EntityMap = {
288
289
  [key in EntityEnum]: EnumToModel<key>[];
289
290
  };
@@ -292,3 +293,6 @@ export type EntityIndexMap = {
292
293
  [id: number]: EnumToModel<key>;
293
294
  };
294
295
  };
296
+ export type IPremissionFilterConfig<T extends EntityEnum | VirtualEntityEnum> = {
297
+ [key: string]: () => Promise<IEntityFilterData<EnumEntityType<T>>>;
298
+ };
@@ -0,0 +1,24 @@
1
+ import { IBillingTransactionApiEntity } from "../../api";
2
+ import { BillingTransactionStatusEnum } from "../enums/billing-transaction-status.enum";
3
+ import { BillingTransactionType } from "../enums/billing.transaction.enum";
4
+ import { EntityEnum } from "../interface/entity.utils.interface";
5
+ import { BaseEntityModel } from "./base.entity.model";
6
+ export declare class BillingTransactionEntityModel extends BaseEntityModel<EntityEnum.BILLING_TRANSACTION> implements IBillingTransactionApiEntity {
7
+ id: number;
8
+ billingId: number;
9
+ type: BillingTransactionType;
10
+ amount: number;
11
+ details: string;
12
+ bankCharges?: number;
13
+ bankId?: number;
14
+ paymentDate?: string;
15
+ referenceNo?: string;
16
+ supportingDocsUrls?: string;
17
+ status: BillingTransactionStatusEnum;
18
+ createdOn: string;
19
+ updatedOn: string;
20
+ createdBy: number;
21
+ updatedBy: number;
22
+ getRelationConfigs(): any;
23
+ static fromApiEntity(apiEntity: IBillingTransactionApiEntity): BillingTransactionEntityModel;
24
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingTransactionEntityModel = void 0;
4
+ const billing_transaction_status_enum_1 = require("../enums/billing-transaction-status.enum");
5
+ const billing_transaction_enum_1 = require("../enums/billing.transaction.enum");
6
+ const entity_utils_interface_1 = require("../interface/entity.utils.interface");
7
+ const base_entity_model_1 = require("./base.entity.model");
8
+ class BillingTransactionEntityModel extends base_entity_model_1.BaseEntityModel {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.id = 0;
12
+ this.billingId = 0;
13
+ this.type = billing_transaction_enum_1.BillingTransactionType.PAYMENT;
14
+ this.amount = 0;
15
+ this.details = "";
16
+ this.status = billing_transaction_status_enum_1.BillingTransactionStatusEnum.APPROVED;
17
+ this.createdOn = "";
18
+ this.updatedOn = "";
19
+ this.createdBy = 0;
20
+ this.updatedBy = 0;
21
+ }
22
+ // billing?: BillingEntityModel;
23
+ // bank?: BankEntityModel;
24
+ getRelationConfigs() {
25
+ return this.constructor.prototype.constructor.relationConfigs;
26
+ }
27
+ // static relationConfigs: RelationConfigs<
28
+ // [EntityEnum.BILLING, EntityEnum.BANK],
29
+ // EnumEntityType<EntityEnum.BILLING_TRANSACTION>
30
+ // > = [
31
+ // {
32
+ // name: EntityEnum.BILLING,
33
+ // relation: RelationType.ONE,
34
+ // key: "billing",
35
+ // mapKeyConfig: {
36
+ // relationKey: "id", // billing.id
37
+ // key: "billingId", // billingTransaction.billingId
38
+ // },
39
+ // },
40
+ // {
41
+ // name: EntityEnum.BANK,
42
+ // relation: RelationType.ONE,
43
+ // key: "bank",
44
+ // mapKeyConfig: {
45
+ // relationKey: "id", // bank.id
46
+ // key: "bankId", // billingTransaction.bankId
47
+ // },
48
+ // },
49
+ // ];
50
+ static fromApiEntity(apiEntity) {
51
+ const entity = new BillingTransactionEntityModel(entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION);
52
+ Object.assign(entity, apiEntity);
53
+ return entity;
54
+ }
55
+ }
56
+ exports.BillingTransactionEntityModel = BillingTransactionEntityModel;
@@ -11,6 +11,7 @@ import { BankEntityModel } from "./bank.entity.model";
11
11
  import { BaseEntityModel } from "./base.entity.model";
12
12
  import { BillingReimbursementExpneseEntityModel } from "./billing-reimbursement-expense.entity.model";
13
13
  import { BillingTimesheetEntityModel } from "./billing-timesheet.entity.model";
14
+ import { BillingTransactionEntityModel } from "./billing-transaction.model";
14
15
  import { ClientEntityModel } from "./client.entity.model";
15
16
  import { ProjectEntityModel } from "./project.entity.model";
16
17
  import { ReimbursementExpenseEntityModel } from "./reimbursement-expense.entity.model";
@@ -59,6 +60,7 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
59
60
  reimbursementExpense?: ReimbursementExpenseEntityModel[];
60
61
  bank?: BankEntityModel[];
61
62
  billingTimesheets?: BillingTimesheetEntityModel[];
63
+ billingTransactions?: BillingTransactionEntityModel[];
62
64
  static relationConfigs: RelationConfigs<[
63
65
  EntityEnum.PROJECT,
64
66
  EntityEnum.CLIENT,
@@ -66,7 +68,8 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
66
68
  EntityEnum.REIMBURSEMENT_EXPENSE,
67
69
  EntityEnum.BILLING_REIMBURSEMENT_EXPENSE,
68
70
  EntityEnum.BILLING_TIMESHEET,
69
- EntityEnum.BANK
71
+ EntityEnum.BANK,
72
+ EntityEnum.BILLING_TRANSACTION
70
73
  ], EnumEntityType<EntityEnum.BILLING>>;
71
74
  static fromApiEntity(apiEntity: IBillingApiEntity): BillingEntityModel;
72
75
  getStatusCategory(): BillingStatusCategoryEnumForUI;
@@ -243,4 +243,13 @@ BillingEntityModel.relationConfigs = [
243
243
  key: "bankId",
244
244
  },
245
245
  },
246
+ {
247
+ name: entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION,
248
+ relation: relation_type_enum_1.RelationType.ONE,
249
+ key: "billingTransactions",
250
+ mapKeyConfig: {
251
+ relationKey: "billingId",
252
+ key: "id",
253
+ },
254
+ },
246
255
  ];
@@ -9,6 +9,7 @@ const bank_entity_model_1 = require("./bank.entity.model");
9
9
  const base_entity_model_1 = require("./base.entity.model");
10
10
  const billing_reimbursement_expense_entity_model_1 = require("./billing-reimbursement-expense.entity.model");
11
11
  const billing_timesheet_entity_model_1 = require("./billing-timesheet.entity.model");
12
+ const billing_transaction_model_1 = require("./billing-transaction.model");
12
13
  const billing_entity_model_1 = require("./billing.entity.model");
13
14
  const client_affiliate_entity_model_1 = require("./client-affiliate.entity.model");
14
15
  const client_entity_model_1 = require("./client.entity.model");
@@ -64,6 +65,7 @@ function parseEntities(json, baseEntity, entityMap) {
64
65
  [entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromApiEntity,
65
66
  [entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromApiEntity,
66
67
  [entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromApiEntity,
68
+ [entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromApiEntity,
67
69
  };
68
70
  if (!(baseEntity in entityFromJsonMappings)) {
69
71
  throw new Error(`Unknown entity: ${baseEntity}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.19.1-beta.4",
3
+ "version": "10.19.1-beta.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [