law-common 10.18.0 → 10.18.1-beta.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 +2 -0
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/interface/billing-reimbursement-expense-history.api.d.ts +4 -0
- package/dist/src/api/interface/billing-reimbursement-expense-history.api.js +2 -0
- package/dist/src/api/interface/billing-reimbursement-expense.api.d.ts +3 -0
- package/dist/src/api/interface/billing-reimbursement-expense.api.js +2 -0
- package/dist/src/api/interface/billing.create.dto.interface.d.ts +25 -5
- package/dist/src/api/interface/billing.entity.response.d.ts +3 -1
- package/dist/src/entities/enums/billing-reimburement-expense-impact.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-reimburement-expense-impact.enum.js +9 -0
- package/dist/src/entities/enums/billing-reimbursement-expense-change-status.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-reimbursement-expense-change-status.enum.js +9 -0
- package/dist/src/entities/enums/billing-type.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-type.enum.js +9 -0
- package/dist/src/entities/index.d.ts +5 -0
- package/dist/src/entities/index.js +5 -0
- package/dist/src/entities/interface/billing-reimbursement-expense-history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/billing-reimbursement-expense-history.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing-reimbursement-expense.entity.interface.d.ts +23 -0
- package/dist/src/entities/interface/billing-reimbursement-expense.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing.entity.interface.d.ts +2 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +7 -3
- package/dist/src/entities/interface/entity.utils.interface.js +3 -0
- package/dist/src/entities/interface/leave.entity.interface.d.ts +10 -1
- package/dist/src/entities/interface/leave.entity.interface.js +26 -0
- package/dist/src/entities/model/bank.entity.model.d.ts +20 -0
- package/dist/src/entities/model/bank.entity.model.js +27 -0
- package/dist/src/entities/model/leave.entity.model.d.ts +1 -0
- package/dist/src/entities/model/leave.entity.model.js +20 -1
- package/dist/src/utils/models/date-code.model.util.d.ts +1 -0
- package/dist/src/utils/models/date-code.model.util.js +3 -0
- package/package.json +35 -35
package/dist/src/api/index.d.ts
CHANGED
|
@@ -80,3 +80,5 @@ export * from "./interface/holiday-list.entity.response";
|
|
|
80
80
|
export * from "./interface/cron-job-manual-trigger.dto.interface";
|
|
81
81
|
export * from "./interface/cron-job.entity.response";
|
|
82
82
|
export * from "./interface/to-do.entity.api";
|
|
83
|
+
export * from "./interface/billing-reimbursement-expense.api";
|
|
84
|
+
export * from "./interface/billing-reimbursement-expense-history.api";
|
package/dist/src/api/index.js
CHANGED
|
@@ -96,3 +96,5 @@ __exportStar(require("./interface/holiday-list.entity.response"), exports);
|
|
|
96
96
|
__exportStar(require("./interface/cron-job-manual-trigger.dto.interface"), exports);
|
|
97
97
|
__exportStar(require("./interface/cron-job.entity.response"), exports);
|
|
98
98
|
__exportStar(require("./interface/to-do.entity.api"), exports);
|
|
99
|
+
__exportStar(require("./interface/billing-reimbursement-expense.api"), exports);
|
|
100
|
+
__exportStar(require("./interface/billing-reimbursement-expense-history.api"), exports);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IApiEntity } from "../../entities";
|
|
2
|
+
import { IBillingReimbursementExpenseHistoryEntity } from "../../entities/interface/billing-reimbursement-expense-history.entity.interface";
|
|
3
|
+
export type IBillingReimbursementExpenseHistoryApiEntity = IApiEntity<IBillingReimbursementExpenseHistoryEntity>;
|
|
4
|
+
export type IBillingReimbursementExpenseHistoryApiEntityArray = IBillingReimbursementExpenseHistoryApiEntity[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IApiEntity, IBillingReimbursementExpenseEntity } from "../../entities";
|
|
2
|
+
export type IBillingReimbursementExpenseApiEntity = IApiEntity<IBillingReimbursementExpenseEntity>;
|
|
3
|
+
export type IBillingReimbursementExpenseApiEntityArray = IBillingReimbursementExpenseApiEntity[];
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { BillingImpactEnum, BillingStatusEnum, IBillingEntity, IBillingTimesheetEntity, IEntityCreateDto, IProjectEntity, ITimesheetEntity } from "../../entities";
|
|
1
|
+
import { BillingImpactEnum, BillingReimbursementExpenseChangedStatusEnum, BillingStatusEnum, IBillingEntity, IBillingTimesheetEntity, IEntityCreateDto, IProjectEntity, ITimesheetEntity } from "../../entities";
|
|
2
2
|
export type IBillingCreateExclude = "paymentStatus" | "status" | "writeoffAmount" | "tdsAmount" | "totalAmountPaid" | "creditNoteAmount" | "invoicePdfUrl";
|
|
3
|
-
export interface IBillingCreateDto extends Omit<IEntityCreateDto<IBillingEntity>, IBillingCreateExclude> {
|
|
4
|
-
timesheets
|
|
3
|
+
export interface IBillingCreateDto extends Omit<IEntityCreateDto<IBillingEntity>, IBillingCreateExclude | "particulars"> {
|
|
4
|
+
timesheets?: IBillingTimesheetsDto;
|
|
5
5
|
status?: BillingStatusEnum;
|
|
6
|
+
reimbursementExpenses?: IBillingReimbursementExpenseCreateDtoDetails[];
|
|
7
|
+
particulars: IBillingParticulars;
|
|
6
8
|
}
|
|
7
|
-
export interface
|
|
9
|
+
export interface IBillingParticulars {
|
|
10
|
+
invoiceText?: string;
|
|
11
|
+
debitNoteText?: string;
|
|
12
|
+
includeDebitNoteSummary: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface IBillingCreateDtoExtra {
|
|
15
|
+
particulars: IBillingParticulars[];
|
|
16
|
+
}
|
|
17
|
+
export interface IBillingTimesheetUnchangedDto {
|
|
8
18
|
id: number;
|
|
9
19
|
amount: number;
|
|
10
20
|
}
|
|
@@ -20,7 +30,7 @@ export interface IBillingTimesheetUpdateDeleteDetailDto {
|
|
|
20
30
|
}
|
|
21
31
|
export interface IBillingTimesheetsDto {
|
|
22
32
|
all: number[];
|
|
23
|
-
unchanged:
|
|
33
|
+
unchanged: IBillingTimesheetUnchangedDto[];
|
|
24
34
|
updateDetails: IBillingTimesheetUpdateDeleteDetailDto[];
|
|
25
35
|
deleteDetails: IBillingTimesheetUpdateDeleteDetailDto[];
|
|
26
36
|
}
|
|
@@ -29,3 +39,13 @@ export interface IBillingEntityCreateDtoValidationData {
|
|
|
29
39
|
billingTimesheetEntities: IBillingTimesheetEntity[];
|
|
30
40
|
timesheetEntities: ITimesheetEntity[];
|
|
31
41
|
}
|
|
42
|
+
export interface IBillingReimbursementExpenseCreateDtoDetails {
|
|
43
|
+
userId: number;
|
|
44
|
+
reimbursementExpenseId: number;
|
|
45
|
+
projectId: number;
|
|
46
|
+
expenseType: string;
|
|
47
|
+
totalAmount: number;
|
|
48
|
+
expenseIncurredDate: string;
|
|
49
|
+
changedStatus: BillingReimbursementExpenseChangedStatusEnum;
|
|
50
|
+
amendmentPurpose: string;
|
|
51
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BillingActionsEnum, BillingStatusEnum, IBillingEntity } from "../../entities";
|
|
2
|
+
import { IBillingReimbursementExpenseApiEntity } from "./billing-reimbursement-expense.api";
|
|
2
3
|
import { IBillingApiEntity } from "./billing.entity.api";
|
|
3
4
|
import { IBillingTimesheetApiEntity } from "./billing.timesheet.entity.api";
|
|
4
5
|
import { IUpdateBillingDto } from "./billing.update.dto.interface";
|
|
@@ -6,7 +7,8 @@ import { IProjectApiEntity } from "./project.entity.response";
|
|
|
6
7
|
import { IUserApiEntity } from "./user.entity.api";
|
|
7
8
|
export type IBillingEntityResponse = {
|
|
8
9
|
billing: IBillingApiEntity;
|
|
9
|
-
billingTimesheets
|
|
10
|
+
billingTimesheets?: IBillingTimesheetApiEntity[];
|
|
11
|
+
billingReimbursementExpenses?: IBillingReimbursementExpenseApiEntity[];
|
|
10
12
|
};
|
|
11
13
|
export interface IUserEntityRelation {
|
|
12
14
|
users?: IUserApiEntity[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingReimbursementExpenseImpactEnum = void 0;
|
|
4
|
+
var BillingReimbursementExpenseImpactEnum;
|
|
5
|
+
(function (BillingReimbursementExpenseImpactEnum) {
|
|
6
|
+
BillingReimbursementExpenseImpactEnum["POSITIVE"] = "positive";
|
|
7
|
+
BillingReimbursementExpenseImpactEnum["NEUTRAL"] = "neutral";
|
|
8
|
+
BillingReimbursementExpenseImpactEnum["NEGATIVE"] = "negative";
|
|
9
|
+
})(BillingReimbursementExpenseImpactEnum || (exports.BillingReimbursementExpenseImpactEnum = BillingReimbursementExpenseImpactEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingReimbursementExpenseChangedStatusEnum = void 0;
|
|
4
|
+
var BillingReimbursementExpenseChangedStatusEnum;
|
|
5
|
+
(function (BillingReimbursementExpenseChangedStatusEnum) {
|
|
6
|
+
BillingReimbursementExpenseChangedStatusEnum["UNCHANGED"] = "unchanged";
|
|
7
|
+
BillingReimbursementExpenseChangedStatusEnum["UPDATED"] = "updated";
|
|
8
|
+
BillingReimbursementExpenseChangedStatusEnum["DELETED"] = "deleted";
|
|
9
|
+
})(BillingReimbursementExpenseChangedStatusEnum || (exports.BillingReimbursementExpenseChangedStatusEnum = BillingReimbursementExpenseChangedStatusEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingTypeEnum = void 0;
|
|
4
|
+
var BillingTypeEnum;
|
|
5
|
+
(function (BillingTypeEnum) {
|
|
6
|
+
BillingTypeEnum["DEBIT_NOTE"] = "debitNote";
|
|
7
|
+
BillingTypeEnum["INVOICE"] = "invoice";
|
|
8
|
+
BillingTypeEnum["BOTH"] = "both";
|
|
9
|
+
})(BillingTypeEnum || (exports.BillingTypeEnum = BillingTypeEnum = {}));
|
|
@@ -74,3 +74,8 @@ export * from "./enums/timezone.enum";
|
|
|
74
74
|
export * from "./interface/cron-job.entity.interface";
|
|
75
75
|
export * from "./model/configuration.model";
|
|
76
76
|
export * from "./interface/to-do.entity.interface";
|
|
77
|
+
export * from "./enums/billing-type.enum";
|
|
78
|
+
export * from "./interface/billing-reimbursement-expense.entity.interface";
|
|
79
|
+
export * from "./enums/billing-reimbursement-expense-change-status.enum";
|
|
80
|
+
export * from "./interface/billing-reimbursement-expense-history.entity.interface";
|
|
81
|
+
export * from "./enums/billing-reimburement-expense-impact.enum";
|
|
@@ -91,3 +91,8 @@ __exportStar(require("./enums/timezone.enum"), exports);
|
|
|
91
91
|
__exportStar(require("./interface/cron-job.entity.interface"), exports);
|
|
92
92
|
__exportStar(require("./model/configuration.model"), exports);
|
|
93
93
|
__exportStar(require("./interface/to-do.entity.interface"), exports);
|
|
94
|
+
__exportStar(require("./enums/billing-type.enum"), exports);
|
|
95
|
+
__exportStar(require("./interface/billing-reimbursement-expense.entity.interface"), exports);
|
|
96
|
+
__exportStar(require("./enums/billing-reimbursement-expense-change-status.enum"), exports);
|
|
97
|
+
__exportStar(require("./interface/billing-reimbursement-expense-history.entity.interface"), exports);
|
|
98
|
+
__exportStar(require("./enums/billing-reimburement-expense-impact.enum"), exports);
|
package/dist/src/entities/interface/billing-reimbursement-expense-history.entity.interface.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IBaseHistoryEntity, IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
|
|
2
|
+
export interface IBillingReimbursementExpenseHistoryEntity extends IBaseHistoryEntity {
|
|
3
|
+
}
|
|
4
|
+
export interface IBillingReimbursementExpenseHistoryCreateDto extends IEntityCreateDto<IBillingReimbursementExpenseHistoryEntity> {
|
|
5
|
+
}
|
|
6
|
+
export interface IBillingReimbursementExpenseHistorySearchDto extends IEntityFilterData<IBillingReimbursementExpenseHistoryEntity> {
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BillingReimbursementExpenseImpactEnum } from "../enums/billing-reimburement-expense-impact.enum";
|
|
2
|
+
import { BillingReimbursementExpenseChangedStatusEnum } from "../enums/billing-reimbursement-expense-change-status.enum";
|
|
3
|
+
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
4
|
+
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
5
|
+
export interface IBillingReimbursementExpenseEntity extends IAuditColumnEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
billingId: number;
|
|
8
|
+
userId: number;
|
|
9
|
+
reimbursementExpenseId: number;
|
|
10
|
+
projectId: number;
|
|
11
|
+
expenseType: string;
|
|
12
|
+
totalAmount: number;
|
|
13
|
+
expenseIncurredDate: string;
|
|
14
|
+
changedStatus: BillingReimbursementExpenseChangedStatusEnum;
|
|
15
|
+
amendmentPurpose?: string;
|
|
16
|
+
impact?: BillingReimbursementExpenseImpactEnum;
|
|
17
|
+
}
|
|
18
|
+
export interface IBillingReimbursementExpenseCreateDto extends IEntityCreateDto<IBillingReimbursementExpenseEntity> {
|
|
19
|
+
}
|
|
20
|
+
export interface IBillingReimbursementExpenseUpdateDto extends IEntityUpdateDto<IBillingReimbursementExpenseEntity> {
|
|
21
|
+
}
|
|
22
|
+
export interface IBillingReimbursementExpenseFilterData extends IEntityFilterData<IBillingReimbursementExpenseEntity> {
|
|
23
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CurrencyEnum } from "../../enums";
|
|
2
|
+
import { BillingTypeEnum } from "../enums/billing-type.enum";
|
|
2
3
|
import { BillingStatusEnum } from "../enums/billing.status.enum";
|
|
3
4
|
import { BillingInvoiceTypeEnum } from "../enums/billing_invoice_type.enum";
|
|
4
5
|
import { PaymentStatusEnum } from "../enums/payment_status.enum";
|
|
@@ -26,6 +27,7 @@ export interface IBillingEntity extends IAuditColumnEntity {
|
|
|
26
27
|
conversionRate?: number;
|
|
27
28
|
particulars: string;
|
|
28
29
|
currency: CurrencyEnum;
|
|
30
|
+
type: BillingTypeEnum;
|
|
29
31
|
}
|
|
30
32
|
export interface IBillingEntityFilterDto extends IEntityFilterData<IBillingEntity> {
|
|
31
33
|
}
|
|
@@ -6,6 +6,7 @@ import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
|
6
6
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
7
7
|
import { IBankEntity } from "./bank.entity.interface";
|
|
8
8
|
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
9
|
+
import { IBillingReimbursementExpenseEntity } from "./billing-reimbursement-expense.entity.interface";
|
|
9
10
|
import { IBillingEntity } from "./billing.entity.interface";
|
|
10
11
|
import { IBillingPaymentEntity } from "./billing_payment.entity.interface";
|
|
11
12
|
import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
@@ -21,7 +22,7 @@ import { IHolidayListEntity } from "./holiday-list.entity.interface";
|
|
|
21
22
|
import { IHolidayEntity } from "./holiday.entity.interface";
|
|
22
23
|
import { IIndustryEntity } from "./industry.entity.interface";
|
|
23
24
|
import { IIntermediaryBankEntity } from "./intermediary_bank.entity.interface";
|
|
24
|
-
import { ILeaveEntity, IUserLeaveVirtualEntity } from "./leave.entity.interface";
|
|
25
|
+
import { ILeaveCountVirtualEntity, ILeaveEntity, IUserLeaveVirtualEntity } from "./leave.entity.interface";
|
|
25
26
|
import { ILeaveHistoryEntity } from "./leave_history.entity.interface";
|
|
26
27
|
import { IOfficeLocationEntity } from "./office.location.entity";
|
|
27
28
|
import { IOrganizationEntity } from "./organization.entity.interface";
|
|
@@ -82,7 +83,9 @@ export declare enum EntityEnum {
|
|
|
82
83
|
BILLING = "billing",
|
|
83
84
|
BILLING_HISTORY = "billing_history",
|
|
84
85
|
BILLING_TIMESHEET = "billing_timesheet",
|
|
86
|
+
BILLING_REIMBURSEMENT_EXPENSE = "billing_reimbursement_expense",
|
|
85
87
|
BILLING_TIMESHEET_HISTORY = "billing_timesheet_history",
|
|
88
|
+
BILLING_REIMBURESMENT_EXPENSE_HISTORY = "billing_reimbursement_expense_history",
|
|
86
89
|
TIMESHEET = "timesheet",
|
|
87
90
|
TIMESHEET_HISTORY = "timesheet_history",
|
|
88
91
|
USER = "user",
|
|
@@ -141,7 +144,7 @@ export type IBaseEntityApiResponse<T extends {
|
|
|
141
144
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
142
145
|
};
|
|
143
146
|
};
|
|
144
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : 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 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) & {
|
|
147
|
+
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) & {
|
|
145
148
|
id: number;
|
|
146
149
|
};
|
|
147
150
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -259,7 +262,8 @@ export type IHistoryEntityChangedLogs<T> = {
|
|
|
259
262
|
timeStamp: string;
|
|
260
263
|
};
|
|
261
264
|
export declare enum VirtualEntityEnum {
|
|
262
|
-
USER_LEAVE = "user_leave"
|
|
265
|
+
USER_LEAVE = "user_leave",
|
|
266
|
+
LEAVE_COUNT = "leave_count"
|
|
263
267
|
}
|
|
264
268
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
265
269
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
@@ -36,7 +36,9 @@ var EntityEnum;
|
|
|
36
36
|
EntityEnum["BILLING"] = "billing";
|
|
37
37
|
EntityEnum["BILLING_HISTORY"] = "billing_history";
|
|
38
38
|
EntityEnum["BILLING_TIMESHEET"] = "billing_timesheet";
|
|
39
|
+
EntityEnum["BILLING_REIMBURSEMENT_EXPENSE"] = "billing_reimbursement_expense";
|
|
39
40
|
EntityEnum["BILLING_TIMESHEET_HISTORY"] = "billing_timesheet_history";
|
|
41
|
+
EntityEnum["BILLING_REIMBURESMENT_EXPENSE_HISTORY"] = "billing_reimbursement_expense_history";
|
|
40
42
|
EntityEnum["TIMESHEET"] = "timesheet";
|
|
41
43
|
EntityEnum["TIMESHEET_HISTORY"] = "timesheet_history";
|
|
42
44
|
EntityEnum["USER"] = "user";
|
|
@@ -78,4 +80,5 @@ var EntityEnum;
|
|
|
78
80
|
var VirtualEntityEnum;
|
|
79
81
|
(function (VirtualEntityEnum) {
|
|
80
82
|
VirtualEntityEnum["USER_LEAVE"] = "user_leave";
|
|
83
|
+
VirtualEntityEnum["LEAVE_COUNT"] = "leave_count";
|
|
81
84
|
})(VirtualEntityEnum || (exports.VirtualEntityEnum = VirtualEntityEnum = {}));
|
|
@@ -2,7 +2,7 @@ import { DurationTypeEnum } from "../enums/duration-type.enum";
|
|
|
2
2
|
import { LeaveTypeEnum } from "../enums/leave-type.enum";
|
|
3
3
|
import { LeaveStatusEnum } from "../enums/leave.status.enum";
|
|
4
4
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
5
|
-
import { IEntityFilterData } from "./entity.utils.interface";
|
|
5
|
+
import { EnumEntityType, IEntityFilterData, VirtualEntityEnum } from "./entity.utils.interface";
|
|
6
6
|
import { IUserEntity } from "./user.entity.interface";
|
|
7
7
|
export interface ILeaveEntity extends IAuditColumnEntity {
|
|
8
8
|
id: number;
|
|
@@ -38,3 +38,12 @@ export interface IUserLeaveVirtualEntity extends IAuditColumnEntity {
|
|
|
38
38
|
type: LeaveTypeEnum;
|
|
39
39
|
id: number;
|
|
40
40
|
}
|
|
41
|
+
export interface ILeaveCountVirtualEntity extends IAuditColumnEntity {
|
|
42
|
+
id: number;
|
|
43
|
+
period: string;
|
|
44
|
+
leaveId?: number;
|
|
45
|
+
count: number;
|
|
46
|
+
}
|
|
47
|
+
export declare const virtualEntityToKeysMap: {
|
|
48
|
+
[K in VirtualEntityEnum]: (keyof EnumEntityType<K>)[];
|
|
49
|
+
};
|
|
@@ -1,2 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.virtualEntityToKeysMap = void 0;
|
|
4
|
+
const entity_utils_interface_1 = require("./entity.utils.interface");
|
|
5
|
+
exports.virtualEntityToKeysMap = {
|
|
6
|
+
[entity_utils_interface_1.VirtualEntityEnum.LEAVE_COUNT]: [
|
|
7
|
+
"createdBy",
|
|
8
|
+
"createdOn",
|
|
9
|
+
"leaveId",
|
|
10
|
+
"period",
|
|
11
|
+
"updatedBy",
|
|
12
|
+
"updatedOn",
|
|
13
|
+
"count",
|
|
14
|
+
"id"
|
|
15
|
+
],
|
|
16
|
+
[entity_utils_interface_1.VirtualEntityEnum.USER_LEAVE]: [
|
|
17
|
+
"createdBy",
|
|
18
|
+
"createdOn",
|
|
19
|
+
"id",
|
|
20
|
+
"leavesPending",
|
|
21
|
+
"leavesTaken",
|
|
22
|
+
"period",
|
|
23
|
+
"type",
|
|
24
|
+
"updatedBy",
|
|
25
|
+
"updatedOn",
|
|
26
|
+
"userId",
|
|
27
|
+
],
|
|
28
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IBankApiEntity } from "../../api";
|
|
2
|
+
import { BankStatusEnum } from "../enums/bank_status.enum";
|
|
3
|
+
export declare class BankEntity implements IBankApiEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
accountName: string;
|
|
6
|
+
organizationId: number;
|
|
7
|
+
name: string;
|
|
8
|
+
accountNo: string;
|
|
9
|
+
branchAddress: string;
|
|
10
|
+
ifscCode: string;
|
|
11
|
+
emailForPaymentInfoCsv: string;
|
|
12
|
+
status: BankStatusEnum;
|
|
13
|
+
remark?: string;
|
|
14
|
+
swiftAddress?: string;
|
|
15
|
+
createdBy: number;
|
|
16
|
+
updatedBy: number;
|
|
17
|
+
createdOn: string;
|
|
18
|
+
updatedOn: string;
|
|
19
|
+
static fromApiEntity(apiEntity: IBankApiEntity): BankEntity;
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BankEntity = void 0;
|
|
4
|
+
const bank_status_enum_1 = require("../enums/bank_status.enum");
|
|
5
|
+
class BankEntity {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.id = 0;
|
|
8
|
+
this.accountName = "";
|
|
9
|
+
this.organizationId = 0;
|
|
10
|
+
this.name = "";
|
|
11
|
+
this.accountNo = "";
|
|
12
|
+
this.branchAddress = "";
|
|
13
|
+
this.ifscCode = "";
|
|
14
|
+
this.emailForPaymentInfoCsv = "";
|
|
15
|
+
this.status = bank_status_enum_1.BankStatusEnum.CREATE_APPROVAL;
|
|
16
|
+
this.createdBy = 0;
|
|
17
|
+
this.updatedBy = 0;
|
|
18
|
+
this.createdOn = `${new Date()}`;
|
|
19
|
+
this.updatedOn = `${new Date()}`;
|
|
20
|
+
}
|
|
21
|
+
static fromApiEntity(apiEntity) {
|
|
22
|
+
const entity = new BankEntity();
|
|
23
|
+
Object.assign(entity, apiEntity);
|
|
24
|
+
return entity;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.BankEntity = BankEntity;
|
|
@@ -19,6 +19,7 @@ export declare class LeaveEntityModel implements ILeaveEntity {
|
|
|
19
19
|
updatedBy: number;
|
|
20
20
|
private constructor();
|
|
21
21
|
static fromEntity(data: ILeaveEntity): LeaveEntityModel;
|
|
22
|
+
isMoreThanOneDayLeave(): boolean;
|
|
22
23
|
getLeaveDuration(excludeWeekdays?: Weekday[], excludeDates?: DateCodeModel[]): number;
|
|
23
24
|
static getLeaveDuration(leaves: LeaveEntityModel[], excludeWeekdays?: Weekday[], excludeDates?: DateCodeModel[], leaveStatusEnum?: LeaveStatusEnum[]): number;
|
|
24
25
|
getDateCodeModels(dateCodeIncludePredicates?: ((dateModel: DateCodeModel) => boolean)[], dateCodeExcludePredicates?: ((dateModel: DateCodeModel) => boolean)[]): DateCodeModel[];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LeaveEntityModel = void 0;
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
|
+
const duration_type_enum_1 = require("../enums/duration-type.enum");
|
|
5
6
|
const leave_status_enum_1 = require("../enums/leave.status.enum");
|
|
6
7
|
class LeaveEntityModel {
|
|
7
8
|
constructor(data) {
|
|
@@ -22,10 +23,28 @@ class LeaveEntityModel {
|
|
|
22
23
|
static fromEntity(data) {
|
|
23
24
|
return new LeaveEntityModel(data);
|
|
24
25
|
}
|
|
26
|
+
isMoreThanOneDayLeave() {
|
|
27
|
+
const fromDate = new utils_1.DateCodeModel(this.fromDate);
|
|
28
|
+
const toDate = new utils_1.DateCodeModel(this.toDate);
|
|
29
|
+
return fromDate.diffInDays(toDate) > 1;
|
|
30
|
+
}
|
|
25
31
|
getLeaveDuration(excludeWeekdays = [], excludeDates = []) {
|
|
32
|
+
if (!this.isMoreThanOneDayLeave()) {
|
|
33
|
+
return this.durationType === duration_type_enum_1.DurationTypeEnum.FULL ? 1 : 0.5;
|
|
34
|
+
}
|
|
26
35
|
const fromDate = new utils_1.DateCodeModel(this.fromDate);
|
|
27
36
|
const toDate = new utils_1.DateCodeModel(this.toDate);
|
|
28
|
-
|
|
37
|
+
let count = fromDate.diffInDays(toDate, excludeWeekdays, excludeDates);
|
|
38
|
+
if (this.durationType === duration_type_enum_1.DurationTypeEnum.FULL) {
|
|
39
|
+
return count;
|
|
40
|
+
}
|
|
41
|
+
if (this.durationType === duration_type_enum_1.DurationTypeEnum.SECOND_FIRST) {
|
|
42
|
+
return count - 1;
|
|
43
|
+
}
|
|
44
|
+
if (this.durationType === duration_type_enum_1.DurationTypeEnum.FULL_FIRST || this.durationType === duration_type_enum_1.DurationTypeEnum.SECOND_FULL) {
|
|
45
|
+
return count - 0.5;
|
|
46
|
+
}
|
|
47
|
+
return count;
|
|
29
48
|
}
|
|
30
49
|
// getLeaveDurationByPredicates(predicates: ((leave: LeaveEntityModel) => boolean)[]): number {
|
|
31
50
|
// const fromDate = new DateCodeModel(this.fromDate);
|
|
@@ -222,5 +222,8 @@ class DateCodeModel {
|
|
|
222
222
|
// Number of days in that month
|
|
223
223
|
return (0, date_fns_1.lastDayOfMonth)(date).getDate();
|
|
224
224
|
}
|
|
225
|
+
isPresent(dateCodes) {
|
|
226
|
+
return dateCodes.some((d) => d.isSame(this));
|
|
227
|
+
}
|
|
225
228
|
}
|
|
226
229
|
exports.DateCodeModel = DateCodeModel;
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.18.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
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "10.18.1-beta.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
|
+
}
|