law-common 10.19.1-beta.8 → 10.20.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.
- package/dist/src/api/index.d.ts +0 -1
- package/dist/src/api/index.js +0 -1
- package/dist/src/api/interface/billing.create.dto.interface.d.ts +2 -2
- package/dist/src/api/interface/billing.transaction.create.dto.interface.d.ts +2 -4
- package/dist/src/api/interface/billing.transaction.entity.response.d.ts +1 -11
- package/dist/src/api/interface/billing.transaction.update.dto.interface.d.ts +2 -9
- package/dist/src/entities/index.d.ts +0 -4
- package/dist/src/entities/index.js +0 -4
- package/dist/src/entities/interface/billing.entity.interface.d.ts +0 -1
- package/dist/src/entities/interface/billing_timesheet.entity.interface.d.ts +2 -2
- package/dist/src/entities/interface/billing_transaction.entity.interface.d.ts +0 -7
- package/dist/src/entities/interface/entity.utils.interface.d.ts +2 -8
- package/dist/src/entities/interface/entity.utils.interface.js +0 -1
- package/dist/src/entities/model/billing.entity.model.d.ts +1 -4
- package/dist/src/entities/model/billing.entity.model.js +0 -9
- package/dist/src/entities/model/entity.model.interface.js +0 -2
- package/dist/src/utils/helper.fn.util.d.ts +1 -37
- package/dist/src/utils/helper.fn.util.js +0 -53
- package/package.json +35 -35
- package/dist/src/api/interface/billing-transaction-history.api.d.ts +0 -3
- package/dist/src/api/interface/billing-transaction-history.api.js +0 -2
- package/dist/src/entities/enums/billing-transaction-action.enum.d.ts +0 -11
- package/dist/src/entities/enums/billing-transaction-action.enum.js +0 -15
- package/dist/src/entities/enums/billing-transaction-status.enum.d.ts +0 -6
- package/dist/src/entities/enums/billing-transaction-status.enum.js +0 -10
- package/dist/src/entities/interface/billing-transaction-history.entity.d.ts +0 -7
- package/dist/src/entities/interface/billing-transaction-history.entity.js +0 -2
- package/dist/src/entities/model/billing-transaction.model.d.ts +0 -24
- package/dist/src/entities/model/billing-transaction.model.js +0 -56
package/dist/src/api/index.d.ts
CHANGED
|
@@ -83,4 +83,3 @@ export * from "./interface/to-do.entity.api";
|
|
|
83
83
|
export * from "./interface/billing-reimbursement-expense.api";
|
|
84
84
|
export * from "./interface/billing-reimbursement-expense-history.api";
|
|
85
85
|
export * from "./interface/project-user-mapping.entity.api";
|
|
86
|
-
export * from "./interface/billing-transaction-history.api";
|
package/dist/src/api/index.js
CHANGED
|
@@ -99,4 +99,3 @@ __exportStar(require("./interface/to-do.entity.api"), exports);
|
|
|
99
99
|
__exportStar(require("./interface/billing-reimbursement-expense.api"), exports);
|
|
100
100
|
__exportStar(require("./interface/billing-reimbursement-expense-history.api"), exports);
|
|
101
101
|
__exportStar(require("./interface/project-user-mapping.entity.api"), exports);
|
|
102
|
-
__exportStar(require("./interface/billing-transaction-history.api"), exports);
|
|
@@ -16,7 +16,7 @@ export interface IBillingCreateDtoExtra {
|
|
|
16
16
|
}
|
|
17
17
|
export interface IBillingTimesheetUnchangedDto {
|
|
18
18
|
id: number;
|
|
19
|
-
amount
|
|
19
|
+
amount: number;
|
|
20
20
|
}
|
|
21
21
|
export interface IBillingTimesheetUpdateDeleteDetailDto {
|
|
22
22
|
id: number;
|
|
@@ -24,7 +24,7 @@ export interface IBillingTimesheetUpdateDeleteDetailDto {
|
|
|
24
24
|
description: string;
|
|
25
25
|
date: string;
|
|
26
26
|
duration: number;
|
|
27
|
-
amount
|
|
27
|
+
amount: number;
|
|
28
28
|
impact: BillingImpactEnum;
|
|
29
29
|
amendmentPurpose: string;
|
|
30
30
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
export interface IBillingTransactionCreateDto extends Omit<IEntityCreateDto<IBillingTransactionEntity>, IBillingTransactionExclude> {
|
|
4
|
-
status?: BillingTransactionStatusEnum;
|
|
1
|
+
import { IBillingTransactionEntity, IEntityCreateDto } from "../../entities";
|
|
2
|
+
export interface IBillingTransactionCreateDto extends IEntityCreateDto<IBillingTransactionEntity> {
|
|
5
3
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IApiEntity, IBillingTransactionEntity } from "../../entities";
|
|
2
2
|
import { IBillingApiEntity } from "./billing.entity.api";
|
|
3
3
|
export type IBillingTransactionApiEntity = IApiEntity<IBillingTransactionEntity>;
|
|
4
4
|
export type IBillingTransactionApiEntityArray = IBillingTransactionApiEntity[];
|
|
@@ -6,13 +6,3 @@ export type IBillingTransactionEntityGet = {
|
|
|
6
6
|
billingTransaction: IBillingTransactionApiEntity;
|
|
7
7
|
billing: IBillingApiEntity;
|
|
8
8
|
};
|
|
9
|
-
export type IBillingTransactionFlowConfig = {
|
|
10
|
-
[key in BillingTransactionStatusEnum]?: {
|
|
11
|
-
actions: {
|
|
12
|
-
[key in BillingTransactionActionEnum]?: {
|
|
13
|
-
permissions: string[];
|
|
14
|
-
next: () => BillingTransactionStatusEnum;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
3
|
-
supportingDocsDetails?: string[];
|
|
4
|
-
}
|
|
5
|
-
export interface IBillingTransactionActionDataDto {
|
|
6
|
-
action: BillingTransactionActionEnum;
|
|
7
|
-
}
|
|
8
|
-
export interface IBillingTransactionUpdateDto extends IEntityUpdateDto<IBillingTransactionEntity>, IBillingTransactionSupportingDocsDetails {
|
|
9
|
-
actionData?: IBillingTransactionActionDataDto;
|
|
1
|
+
import { IBillingTransactionEntity, IEntityUpdateDto } from "../../entities";
|
|
2
|
+
export interface IBillingTransactionUpdateDto extends IEntityUpdateDto<IBillingTransactionEntity> {
|
|
10
3
|
}
|
|
@@ -97,7 +97,3 @@ export * from "./model/timesheet.entity.model";
|
|
|
97
97
|
export * from "./model/user.entity.model";
|
|
98
98
|
export * from "./model/client-affiliate.entity.model";
|
|
99
99
|
export * from "./model/billing-timesheet.entity.model";
|
|
100
|
-
export * from "./enums/billing-transaction-action.enum";
|
|
101
|
-
export * from "./enums/billing-transaction-status.enum";
|
|
102
|
-
export * from "./interface/billing-transaction-history.entity";
|
|
103
|
-
export * from "./model/billing-transaction.model";
|
|
@@ -114,7 +114,3 @@ __exportStar(require("./model/timesheet.entity.model"), exports);
|
|
|
114
114
|
__exportStar(require("./model/user.entity.model"), exports);
|
|
115
115
|
__exportStar(require("./model/client-affiliate.entity.model"), exports);
|
|
116
116
|
__exportStar(require("./model/billing-timesheet.entity.model"), exports);
|
|
117
|
-
__exportStar(require("./enums/billing-transaction-action.enum"), exports);
|
|
118
|
-
__exportStar(require("./enums/billing-transaction-status.enum"), exports);
|
|
119
|
-
__exportStar(require("./interface/billing-transaction-history.entity"), exports);
|
|
120
|
-
__exportStar(require("./model/billing-transaction.model"), exports);
|
|
@@ -13,7 +13,7 @@ export interface IBillingTimesheetEntity extends IAuditColumnEntity {
|
|
|
13
13
|
task: string;
|
|
14
14
|
description?: string;
|
|
15
15
|
totalDuration: number;
|
|
16
|
-
totalAmount
|
|
16
|
+
totalAmount: number;
|
|
17
17
|
impact: BillingImpactEnum;
|
|
18
18
|
amendmentPurpose?: string;
|
|
19
19
|
changedStatus: BillingTimesheetStatusEnum;
|
|
@@ -23,7 +23,7 @@ export interface IBillingTimesheetEntityCreateDto extends IEntityCreateDto<IBill
|
|
|
23
23
|
export interface IBillingTimesheetDetail extends IAuditColumnEntity {
|
|
24
24
|
timesheetId: number;
|
|
25
25
|
billingId: number;
|
|
26
|
-
totalAmount
|
|
26
|
+
totalAmount: number;
|
|
27
27
|
changedStatus: BillingTimesheetStatusEnum;
|
|
28
28
|
impact: BillingImpactEnum;
|
|
29
29
|
amendmentPurpose?: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BillingTransactionStatusEnum } from "../enums/billing-transaction-status.enum";
|
|
2
1
|
import { BillingTransactionType } from "../enums/billing.transaction.enum";
|
|
3
2
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
4
3
|
import { IEntityFilterData } from "./entity.utils.interface";
|
|
@@ -8,11 +7,5 @@ export interface IBillingTransactionEntity extends IAuditColumnEntity {
|
|
|
8
7
|
type: BillingTransactionType;
|
|
9
8
|
amount: number;
|
|
10
9
|
details: string;
|
|
11
|
-
bankCharges?: number;
|
|
12
|
-
bankId?: number;
|
|
13
|
-
paymentDate?: string;
|
|
14
|
-
referenceNo?: string;
|
|
15
|
-
supportingDocsUrls?: string;
|
|
16
|
-
status: BillingTransactionStatusEnum;
|
|
17
10
|
}
|
|
18
11
|
export type IBillingTransactionEntityFilterData = IEntityFilterData<IBillingTransactionEntity>;
|
|
@@ -6,7 +6,6 @@ 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";
|
|
10
9
|
import { BillingEntityModel } from "../model/billing.entity.model";
|
|
11
10
|
import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
|
|
12
11
|
import { ClientEntityModel } from "../model/client.entity.model";
|
|
@@ -22,7 +21,6 @@ import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
|
22
21
|
import { IBankEntity } from "./bank.entity.interface";
|
|
23
22
|
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
24
23
|
import { IBillingReimbursementExpenseEntity } from "./billing-reimbursement-expense.entity.interface";
|
|
25
|
-
import { IBillingTransactionHistoryEntity } from "./billing-transaction-history.entity";
|
|
26
24
|
import { IBillingEntity } from "./billing.entity.interface";
|
|
27
25
|
import { IBillingPaymentEntity } from "./billing_payment.entity.interface";
|
|
28
26
|
import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
@@ -123,7 +121,6 @@ export declare enum EntityEnum {
|
|
|
123
121
|
BANK_HISTORY = "bank_history",
|
|
124
122
|
BILLING_PAYMENT = "billing_payment",
|
|
125
123
|
BILLING_TRANSACTION = "billing_transaction",
|
|
126
|
-
BILLING_TRANSACTION_HISTORY = "billing_transaction_history",
|
|
127
124
|
CONFIGURATION = "configuration",
|
|
128
125
|
COUNTRY = "country",
|
|
129
126
|
EXPENSE_TYPE = "expense_type",
|
|
@@ -161,7 +158,7 @@ export type IBaseEntityApiResponse<T extends {
|
|
|
161
158
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
162
159
|
};
|
|
163
160
|
};
|
|
164
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.
|
|
161
|
+
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends VirtualEntityEnum.USER_LEAVE ? IUserLeaveVirtualEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : never) & {
|
|
165
162
|
id: number;
|
|
166
163
|
};
|
|
167
164
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -284,7 +281,7 @@ export declare enum VirtualEntityEnum {
|
|
|
284
281
|
}
|
|
285
282
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
286
283
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
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 :
|
|
284
|
+
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;
|
|
288
285
|
export type EntityMap = {
|
|
289
286
|
[key in EntityEnum]: EnumToModel<key>[];
|
|
290
287
|
};
|
|
@@ -293,6 +290,3 @@ export type EntityIndexMap = {
|
|
|
293
290
|
[id: number]: EnumToModel<key>;
|
|
294
291
|
};
|
|
295
292
|
};
|
|
296
|
-
export type IPremissionFilterConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
297
|
-
[key: string]: () => Promise<IEntityFilterData<EnumEntityType<T>>>;
|
|
298
|
-
};
|
|
@@ -60,7 +60,6 @@ var EntityEnum;
|
|
|
60
60
|
EntityEnum["BANK_HISTORY"] = "bank_history";
|
|
61
61
|
EntityEnum["BILLING_PAYMENT"] = "billing_payment";
|
|
62
62
|
EntityEnum["BILLING_TRANSACTION"] = "billing_transaction";
|
|
63
|
-
EntityEnum["BILLING_TRANSACTION_HISTORY"] = "billing_transaction_history";
|
|
64
63
|
EntityEnum["CONFIGURATION"] = "configuration";
|
|
65
64
|
EntityEnum["COUNTRY"] = "country";
|
|
66
65
|
EntityEnum["EXPENSE_TYPE"] = "expense_type";
|
|
@@ -11,7 +11,6 @@ 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";
|
|
15
14
|
import { ClientEntityModel } from "./client.entity.model";
|
|
16
15
|
import { ProjectEntityModel } from "./project.entity.model";
|
|
17
16
|
import { ReimbursementExpenseEntityModel } from "./reimbursement-expense.entity.model";
|
|
@@ -60,7 +59,6 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
|
|
|
60
59
|
reimbursementExpense?: ReimbursementExpenseEntityModel[];
|
|
61
60
|
bank?: BankEntityModel[];
|
|
62
61
|
billingTimesheets?: BillingTimesheetEntityModel[];
|
|
63
|
-
billingTransactions?: BillingTransactionEntityModel[];
|
|
64
62
|
static relationConfigs: RelationConfigs<[
|
|
65
63
|
EntityEnum.PROJECT,
|
|
66
64
|
EntityEnum.CLIENT,
|
|
@@ -68,8 +66,7 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
|
|
|
68
66
|
EntityEnum.REIMBURSEMENT_EXPENSE,
|
|
69
67
|
EntityEnum.BILLING_REIMBURSEMENT_EXPENSE,
|
|
70
68
|
EntityEnum.BILLING_TIMESHEET,
|
|
71
|
-
EntityEnum.BANK
|
|
72
|
-
EntityEnum.BILLING_TRANSACTION
|
|
69
|
+
EntityEnum.BANK
|
|
73
70
|
], EnumEntityType<EntityEnum.BILLING>>;
|
|
74
71
|
static fromApiEntity(apiEntity: IBillingApiEntity): BillingEntityModel;
|
|
75
72
|
getStatusCategory(): BillingStatusCategoryEnumForUI;
|
|
@@ -243,13 +243,4 @@ 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.MANY,
|
|
249
|
-
key: "billingTransactions",
|
|
250
|
-
mapKeyConfig: {
|
|
251
|
-
relationKey: "billingId",
|
|
252
|
-
key: "id",
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
246
|
];
|
|
@@ -9,7 +9,6 @@ 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");
|
|
13
12
|
const billing_entity_model_1 = require("./billing.entity.model");
|
|
14
13
|
const client_affiliate_entity_model_1 = require("./client-affiliate.entity.model");
|
|
15
14
|
const client_entity_model_1 = require("./client.entity.model");
|
|
@@ -65,7 +64,6 @@ function parseEntities(json, baseEntity, entityMap) {
|
|
|
65
64
|
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromApiEntity,
|
|
66
65
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromApiEntity,
|
|
67
66
|
[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,
|
|
69
67
|
};
|
|
70
68
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
71
69
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityEnum, EnumEntityType, IBaseEntityServiceResponse, IEntityFilterData
|
|
1
|
+
import { EntityEnum, EnumEntityType, IBaseEntityServiceResponse, IEntityFilterData } from "../entities";
|
|
2
2
|
import { Modify } from "../misc";
|
|
3
3
|
export declare function groupByFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T[]>;
|
|
4
4
|
export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T>;
|
|
@@ -176,42 +176,6 @@ export declare function transformDate<T extends {
|
|
|
176
176
|
export declare function capitalizeFirstWord(str: string): string;
|
|
177
177
|
export declare function getEntitiesFromSearchV2Response<E extends EntityEnum, // Enum key like EntityEnum.USER, EntityEnum.PROJECT, etc.
|
|
178
178
|
T extends EnumEntityType<E>>(searchResponseV2: IBaseEntityServiceResponse<EnumEntityType<EntityEnum>>, entityEnumKey: E, EntityClass: new () => T): T[];
|
|
179
|
-
/**
|
|
180
|
-
* Recursively searches for entities of a specific type within a nested `relatedEntities` structure.
|
|
181
|
-
*
|
|
182
|
-
* This function traverses the `relatedEntities` tree, looking for a target entity key.
|
|
183
|
-
* When found, it collects all `baseEntities` for that key and instantiates them
|
|
184
|
-
* as instances of the provided `EntityClass`. The function continues to traverse
|
|
185
|
-
* all nested `relatedEntities` recursively, accumulating all matches.
|
|
186
|
-
*
|
|
187
|
-
* @template E - The enum type representing the target entity key (`EntityEnum`).
|
|
188
|
-
* @template T - The corresponding entity type for the target key (`EnumEntityType<E>`).
|
|
189
|
-
*
|
|
190
|
-
* @param relatedEntities - The nested `relatedEntities` structure, typically from a
|
|
191
|
-
* `IBaseEntityServiceResponse`. Can be undefined, in which case an empty array is returned.
|
|
192
|
-
* @param targetKey - The entity key (`EntityEnum`) to search for in the nested structure.
|
|
193
|
-
* @param EntityClass - A constructor function for the entity type `T`. Used to
|
|
194
|
-
* instantiate new objects from the raw base entity data.
|
|
195
|
-
*
|
|
196
|
-
* @returns An array of entities of type `T` found at any level of the nested structure.
|
|
197
|
-
* If no entities are found, an empty array is returned.
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```ts
|
|
201
|
-
* const billingEntities = findEntitiesAtAnyLevel(
|
|
202
|
-
* projectUserMappingsOfCurrentUser.relatedEntities,
|
|
203
|
-
* EntityEnum.BILLING,
|
|
204
|
-
* BillingEntity
|
|
205
|
-
* );
|
|
206
|
-
*
|
|
207
|
-
* console.log(billingEntities); // [BillingEntity {...}, BillingEntity {...}]
|
|
208
|
-
* ```
|
|
209
|
-
*
|
|
210
|
-
* @note
|
|
211
|
-
* - This function preserves the type of entities by mapping the raw objects to the provided `EntityClass`.
|
|
212
|
-
* - It can handle deeply nested `relatedEntities` structures.
|
|
213
|
-
*/
|
|
214
|
-
export declare function findEntitiesFromSearchV2RelatedEntities<E extends EntityEnum, T extends EnumEntityType<E>>(relatedEntities: IEntityServiceResponse | undefined, targetKey: EntityEnum, EntityClass: new () => T): T[];
|
|
215
179
|
/**
|
|
216
180
|
* Checks if two decimal numbers are approximately equal within a given tolerance.
|
|
217
181
|
*
|
|
@@ -33,7 +33,6 @@ exports.createKeyLabelMap = createKeyLabelMap;
|
|
|
33
33
|
exports.transformDate = transformDate;
|
|
34
34
|
exports.capitalizeFirstWord = capitalizeFirstWord;
|
|
35
35
|
exports.getEntitiesFromSearchV2Response = getEntitiesFromSearchV2Response;
|
|
36
|
-
exports.findEntitiesFromSearchV2RelatedEntities = findEntitiesFromSearchV2RelatedEntities;
|
|
37
36
|
exports.areDecimalNumbersEqual = areDecimalNumbersEqual;
|
|
38
37
|
exports.formatIndianNumber = formatIndianNumber;
|
|
39
38
|
exports.findDuplicateIds = findDuplicateIds;
|
|
@@ -400,58 +399,6 @@ function getEntitiesFromSearchV2Response(searchResponseV2, entityEnumKey, Entity
|
|
|
400
399
|
}
|
|
401
400
|
return (((_a = searchResponseV2.relatedEntities[entityEnumKey]) === null || _a === void 0 ? void 0 : _a.baseEntities) || []).map((entity) => Object.assign(new EntityClass(), entity));
|
|
402
401
|
}
|
|
403
|
-
/**
|
|
404
|
-
* Recursively searches for entities of a specific type within a nested `relatedEntities` structure.
|
|
405
|
-
*
|
|
406
|
-
* This function traverses the `relatedEntities` tree, looking for a target entity key.
|
|
407
|
-
* When found, it collects all `baseEntities` for that key and instantiates them
|
|
408
|
-
* as instances of the provided `EntityClass`. The function continues to traverse
|
|
409
|
-
* all nested `relatedEntities` recursively, accumulating all matches.
|
|
410
|
-
*
|
|
411
|
-
* @template E - The enum type representing the target entity key (`EntityEnum`).
|
|
412
|
-
* @template T - The corresponding entity type for the target key (`EnumEntityType<E>`).
|
|
413
|
-
*
|
|
414
|
-
* @param relatedEntities - The nested `relatedEntities` structure, typically from a
|
|
415
|
-
* `IBaseEntityServiceResponse`. Can be undefined, in which case an empty array is returned.
|
|
416
|
-
* @param targetKey - The entity key (`EntityEnum`) to search for in the nested structure.
|
|
417
|
-
* @param EntityClass - A constructor function for the entity type `T`. Used to
|
|
418
|
-
* instantiate new objects from the raw base entity data.
|
|
419
|
-
*
|
|
420
|
-
* @returns An array of entities of type `T` found at any level of the nested structure.
|
|
421
|
-
* If no entities are found, an empty array is returned.
|
|
422
|
-
*
|
|
423
|
-
* @example
|
|
424
|
-
* ```ts
|
|
425
|
-
* const billingEntities = findEntitiesAtAnyLevel(
|
|
426
|
-
* projectUserMappingsOfCurrentUser.relatedEntities,
|
|
427
|
-
* EntityEnum.BILLING,
|
|
428
|
-
* BillingEntity
|
|
429
|
-
* );
|
|
430
|
-
*
|
|
431
|
-
* console.log(billingEntities); // [BillingEntity {...}, BillingEntity {...}]
|
|
432
|
-
* ```
|
|
433
|
-
*
|
|
434
|
-
* @note
|
|
435
|
-
* - This function preserves the type of entities by mapping the raw objects to the provided `EntityClass`.
|
|
436
|
-
* - It can handle deeply nested `relatedEntities` structures.
|
|
437
|
-
*/
|
|
438
|
-
function findEntitiesFromSearchV2RelatedEntities(relatedEntities, targetKey, EntityClass) {
|
|
439
|
-
if (!relatedEntities)
|
|
440
|
-
return [];
|
|
441
|
-
let result = [];
|
|
442
|
-
for (const key of Object.keys(relatedEntities)) {
|
|
443
|
-
const value = relatedEntities[key];
|
|
444
|
-
// If this key is the target and has baseEntities
|
|
445
|
-
if (key === targetKey && (value === null || value === void 0 ? void 0 : value.baseEntities)) {
|
|
446
|
-
result.push(...value.baseEntities.map((entity) => Object.assign(new EntityClass(), entity)));
|
|
447
|
-
}
|
|
448
|
-
// If value has relatedEntities, recurse
|
|
449
|
-
if (value === null || value === void 0 ? void 0 : value.relatedEntities) {
|
|
450
|
-
result.push(...findEntitiesFromSearchV2RelatedEntities(value.relatedEntities, targetKey, EntityClass));
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
return result;
|
|
454
|
-
}
|
|
455
402
|
/**
|
|
456
403
|
* Checks if two decimal numbers are approximately equal within a given tolerance.
|
|
457
404
|
*
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"build": "npm run clean && tsc",
|
|
12
|
-
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
|
|
13
|
-
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
-
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
-
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
-
"link": "npm run build && npm link",
|
|
17
|
-
"test": "jest"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/jest": "^29.5.13",
|
|
24
|
-
"@types/node": "^22.6.1",
|
|
25
|
-
"jest": "^29.7.0",
|
|
26
|
-
"ts-jest": "^29.2.5",
|
|
27
|
-
"ts-node": "^10.9.2",
|
|
28
|
-
"typescript": "^5.6.2"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@types/express": "^5.0.0",
|
|
32
|
-
"@types/multer": "^1.4.12",
|
|
33
|
-
"date-fns": "^4.1.0"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "10.20.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"build": "npm run clean && tsc",
|
|
12
|
+
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
|
|
13
|
+
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
+
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
+
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
+
"link": "npm run build && npm link",
|
|
17
|
+
"test": "jest"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/jest": "^29.5.13",
|
|
24
|
+
"@types/node": "^22.6.1",
|
|
25
|
+
"jest": "^29.7.0",
|
|
26
|
+
"ts-jest": "^29.2.5",
|
|
27
|
+
"ts-node": "^10.9.2",
|
|
28
|
+
"typescript": "^5.6.2"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@types/express": "^5.0.0",
|
|
32
|
+
"@types/multer": "^1.4.12",
|
|
33
|
+
"date-fns": "^4.1.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare enum BillingTransactionActionEnum {
|
|
2
|
-
UPDATE_PAYMENT = "updatePayment",
|
|
3
|
-
WRITE_OFF = "writeOff",
|
|
4
|
-
CREDIT_NOTE = "creditNote",
|
|
5
|
-
TDS = "tds",
|
|
6
|
-
WRITE_OFF_APPROVAL = "writeOffApproval",
|
|
7
|
-
CREDIT_NOTE_APPROVAL = "creditNoteApproval",
|
|
8
|
-
APPROVE = "approve",
|
|
9
|
-
REJECT = "reject",
|
|
10
|
-
EDIT = "edit"
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BillingTransactionActionEnum = void 0;
|
|
4
|
-
var BillingTransactionActionEnum;
|
|
5
|
-
(function (BillingTransactionActionEnum) {
|
|
6
|
-
BillingTransactionActionEnum["UPDATE_PAYMENT"] = "updatePayment";
|
|
7
|
-
BillingTransactionActionEnum["WRITE_OFF"] = "writeOff";
|
|
8
|
-
BillingTransactionActionEnum["CREDIT_NOTE"] = "creditNote";
|
|
9
|
-
BillingTransactionActionEnum["TDS"] = "tds";
|
|
10
|
-
BillingTransactionActionEnum["WRITE_OFF_APPROVAL"] = "writeOffApproval";
|
|
11
|
-
BillingTransactionActionEnum["CREDIT_NOTE_APPROVAL"] = "creditNoteApproval";
|
|
12
|
-
BillingTransactionActionEnum["APPROVE"] = "approve";
|
|
13
|
-
BillingTransactionActionEnum["REJECT"] = "reject";
|
|
14
|
-
BillingTransactionActionEnum["EDIT"] = "edit";
|
|
15
|
-
})(BillingTransactionActionEnum || (exports.BillingTransactionActionEnum = BillingTransactionActionEnum = {}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BillingTransactionStatusEnum = void 0;
|
|
4
|
-
var BillingTransactionStatusEnum;
|
|
5
|
-
(function (BillingTransactionStatusEnum) {
|
|
6
|
-
BillingTransactionStatusEnum["APPROVED"] = "approved";
|
|
7
|
-
BillingTransactionStatusEnum["REJECTED"] = "rejected";
|
|
8
|
-
BillingTransactionStatusEnum["WRITEOFF_APPROVAL_PENDING"] = "writeoff_approval_pending";
|
|
9
|
-
BillingTransactionStatusEnum["CREDITNOTE_APPROVAL_PENDING"] = "creditnote_approval_pending";
|
|
10
|
-
})(BillingTransactionStatusEnum || (exports.BillingTransactionStatusEnum = BillingTransactionStatusEnum = {}));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IBaseHistoryEntity, IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
|
|
2
|
-
export interface IBillingTransactionHistoryEntity extends IBaseHistoryEntity {
|
|
3
|
-
}
|
|
4
|
-
export interface IBillingTransactionHistoryCreateDto extends IEntityCreateDto<IBillingTransactionHistoryEntity> {
|
|
5
|
-
}
|
|
6
|
-
export interface IBillingTransactionHistorySearchDto extends IEntityFilterData<IBillingTransactionHistoryEntity> {
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
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;
|