law-common 10.26.1-beta.4 → 10.26.1-beta.5

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 (29) hide show
  1. package/dist/src/api/index.d.ts +1 -8
  2. package/dist/src/api/index.js +1 -9
  3. package/dist/src/api/interface/billing.entity.api.d.ts +3 -0
  4. package/dist/src/api/interface/billing.entity.response.d.ts +2 -1
  5. package/dist/src/api/interface/billing.transaction.entity.response.d.ts +3 -2
  6. package/dist/src/entities/interface/billing.entity.interface.d.ts +2 -2
  7. package/dist/src/entities/interface/entity.utils.interface.d.ts +2 -1
  8. package/dist/src/entities/model/billing.entity.model.d.ts +5 -6
  9. package/dist/src/entities/model/billing.entity.model.js +7 -8
  10. package/dist/src/entities/model/entity.model.interface.js +1 -1
  11. package/dist/src/utils/helper.fn.util.d.ts +0 -31
  12. package/dist/src/utils/helper.fn.util.js +0 -34
  13. package/package.json +1 -1
  14. package/dist/src/api/interface/bank_history.api.d.ts +0 -3
  15. package/dist/src/api/interface/billing-reimbursement-expense-history.api.d.ts +0 -4
  16. package/dist/src/api/interface/billing-reimbursement-expense-history.api.js +0 -2
  17. package/dist/src/api/interface/billing.history.api.d.ts +0 -3
  18. package/dist/src/api/interface/billing.history.api.js +0 -2
  19. package/dist/src/api/interface/billing_timesheet_history.api.d.ts +0 -3
  20. package/dist/src/api/interface/billing_timesheet_history.api.js +0 -2
  21. package/dist/src/api/interface/leave_history.api.d.ts +0 -3
  22. package/dist/src/api/interface/leave_history.api.js +0 -2
  23. package/dist/src/api/interface/reimbursement_history.api.d.ts +0 -3
  24. package/dist/src/api/interface/reimbursement_history.api.js +0 -2
  25. package/dist/src/api/interface/timesheet.history.api.d.ts +0 -3
  26. package/dist/src/api/interface/timesheet.history.api.js +0 -2
  27. package/dist/src/api/interface/work_from_home_history.api.d.ts +0 -4
  28. package/dist/src/api/interface/work_from_home_history.api.js +0 -2
  29. /package/dist/src/api/interface/{bank_history.api.js → billing.entity.api.js} +0 -0
@@ -20,6 +20,7 @@ export * from "./interface/billing.entity.response";
20
20
  export * from "./interface/office.location.create.dto.interface";
21
21
  export * from "./interface/office.Location.update.dto.interface";
22
22
  export * from "./interface/office.location.entity.response";
23
+ export * from "./interface/billing.entity.api";
23
24
  export * from "./interface/billing.update.dto.interface";
24
25
  export * from "./interface/bank.create.dto.interface";
25
26
  export * from "./interface/bank.update.dto.interface";
@@ -41,21 +42,13 @@ export * from "./interface/billing.transaction.create.dto.interface";
41
42
  export * from "./interface/billing.transaction.update.dto.interface";
42
43
  export * from "./interface/billing.transaction.entity.response";
43
44
  export * from "./interface/billing.flow.update.dto";
44
- export * from "./interface/timesheet.history.api";
45
- export * from "./interface/billing.history.api";
46
- export * from "./interface/billing_timesheet_history.api";
47
- export * from "./interface/reimbursement_history.api";
48
45
  export * from "./interface/reimbursement_expense.api";
49
- export * from "./interface/bank_history.api";
50
46
  export * from "./interface/leave.create.dto.interface";
51
47
  export * from "./interface/leave.update.dto.interface";
52
48
  export * from "./interface/leave.api";
53
- export * from "./interface/leave_history.api";
54
49
  export * from "./interface/work.from.home.api";
55
50
  export * from "./interface/work.from.home.create.dto.interface";
56
51
  export * from "./interface/work.from.home.update.interface";
57
- export * from "./interface/work_from_home_history.api";
58
52
  export * from "./interface/cron-job-manual-trigger.dto.interface";
59
53
  export * from "./interface/cron-job.entity.response";
60
54
  export * from "./interface/billing-reimbursement-expense.api";
61
- export * from "./interface/billing-reimbursement-expense-history.api";
@@ -36,6 +36,7 @@ __exportStar(require("./interface/billing.entity.response"), exports);
36
36
  __exportStar(require("./interface/office.location.create.dto.interface"), exports);
37
37
  __exportStar(require("./interface/office.Location.update.dto.interface"), exports);
38
38
  __exportStar(require("./interface/office.location.entity.response"), exports);
39
+ __exportStar(require("./interface/billing.entity.api"), exports);
39
40
  __exportStar(require("./interface/billing.update.dto.interface"), exports);
40
41
  __exportStar(require("./interface/bank.create.dto.interface"), exports);
41
42
  __exportStar(require("./interface/bank.update.dto.interface"), exports);
@@ -57,22 +58,13 @@ __exportStar(require("./interface/billing.transaction.create.dto.interface"), ex
57
58
  __exportStar(require("./interface/billing.transaction.update.dto.interface"), exports);
58
59
  __exportStar(require("./interface/billing.transaction.entity.response"), exports);
59
60
  __exportStar(require("./interface/billing.flow.update.dto"), exports);
60
- __exportStar(require("./interface/timesheet.history.api"), exports);
61
- __exportStar(require("./interface/billing.history.api"), exports);
62
- __exportStar(require("./interface/billing_timesheet_history.api"), exports);
63
- __exportStar(require("./interface/reimbursement_history.api"), exports);
64
61
  __exportStar(require("./interface/reimbursement_expense.api"), exports);
65
- __exportStar(require("./interface/bank_history.api"), exports);
66
62
  __exportStar(require("./interface/leave.create.dto.interface"), exports);
67
63
  __exportStar(require("./interface/leave.update.dto.interface"), exports);
68
64
  __exportStar(require("./interface/leave.api"), exports);
69
- __exportStar(require("./interface/leave_history.api"), exports);
70
65
  __exportStar(require("./interface/work.from.home.api"), exports);
71
66
  __exportStar(require("./interface/work.from.home.create.dto.interface"), exports);
72
67
  __exportStar(require("./interface/work.from.home.update.interface"), exports);
73
- __exportStar(require("./interface/work_from_home_history.api"), exports);
74
68
  __exportStar(require("./interface/cron-job-manual-trigger.dto.interface"), exports);
75
69
  __exportStar(require("./interface/cron-job.entity.response"), exports);
76
70
  __exportStar(require("./interface/billing-reimbursement-expense.api"), exports);
77
- __exportStar(require("./interface/billing-reimbursement-expense-history.api"), exports);
78
- // export * from "./interface/project-user-mapping.entity.api";
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, IBillingEntity } from "../../entities";
2
+ export type IBillingApiEntity = IApiEntity<IBillingEntity>;
3
+ export type IBillingApiEntityArray = IBillingApiEntity[];
@@ -1,8 +1,9 @@
1
1
  import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IBillingTimesheetEntity, IProjectEntity, IUserEntity } from "../../entities";
2
2
  import { IBillingReimbursementExpenseApiEntity } from "./billing-reimbursement-expense.api";
3
+ import { IBillingApiEntity } from "./billing.entity.api";
3
4
  import { IUpdateBillingDto } from "./billing.update.dto.interface";
4
5
  export type IBillingEntityResponse = {
5
- billing: IBillingEntity;
6
+ billing: IBillingApiEntity;
6
7
  billingTimesheets?: IBillingTimesheetEntity[];
7
8
  billingReimbursementExpenses?: IBillingReimbursementExpenseApiEntity[];
8
9
  };
@@ -1,7 +1,8 @@
1
- import { IApiEntity, IBillingEntity, IBillingTransactionEntity } from "../../entities";
1
+ import { IApiEntity, IBillingTransactionEntity } from "../../entities";
2
+ import { IBillingApiEntity } from "./billing.entity.api";
2
3
  export type IBillingTransactionApiEntity = IApiEntity<IBillingTransactionEntity>;
3
4
  export type IBillingTransactionApiEntityArray = IBillingTransactionApiEntity[];
4
5
  export type IBillingTransactionEntityGet = {
5
6
  billingTransaction: IBillingTransactionApiEntity;
6
- billing: IBillingEntity;
7
+ billing: IBillingApiEntity;
7
8
  };
@@ -3,9 +3,9 @@ import { BillingTypeEnum } from "../enums/billing-type.enum";
3
3
  import { BillingStatusEnum } from "../enums/billing.status.enum";
4
4
  import { BillingInvoiceTypeEnum } from "../enums/billing_invoice_type.enum";
5
5
  import { PaymentStatusEnum } from "../enums/payment_status.enum";
6
- import { IEntityAuditColumn } from "./entity-audit-columns.interface";
6
+ import { IAuditColumnEntity } from "./audit-column.entity.interface";
7
7
  import { EntityEnum, IEntityFilterData } from "./entity.utils.interface";
8
- export interface IBillingEntity extends IEntityAuditColumn {
8
+ export interface IBillingEntity extends IAuditColumnEntity {
9
9
  id: number;
10
10
  startDate: string;
11
11
  endDate: string;
@@ -31,6 +31,7 @@ import { IConfigurationEntity } from "./configuration.entity.interface";
31
31
  import { ICountryEntity } from "./country.entity.interface";
32
32
  import { ICronJobsEntity } from "./cron-job.entity.interface";
33
33
  import { IDesignationEntity } from "./designation.entity.interface";
34
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
34
35
  import { IExpenseTypeEntity } from "./expense_type.entity.interface";
35
36
  import { IHolidayListEntity } from "./holiday-list.entity.interface";
36
37
  import { IHolidayEntity } from "./holiday.entity.interface";
@@ -251,7 +252,7 @@ export type IEntitySearchSinceConstraint = {
251
252
  columnKey: string;
252
253
  value: number;
253
254
  };
254
- export interface IBaseHistoryEntity extends IAuditColumnEntity {
255
+ export interface IBaseHistoryEntity extends IEntityAuditColumn {
255
256
  id: number;
256
257
  entityId: number;
257
258
  operation: HistoryOperationEnum;
@@ -1,11 +1,10 @@
1
- import { IBillingFlowConfig } from "../../api";
1
+ import { IBillingApiEntity, IBillingFlowConfig } from "../../api";
2
2
  import { CurrencyEnum } from "../../enums";
3
3
  import { BillingTypeEnum } from "../enums/billing-type.enum";
4
4
  import { BillingActionsEnum } from "../enums/billing.action.enum";
5
5
  import { BillingStatusEnum } from "../enums/billing.status.enum";
6
6
  import { BillingInvoiceTypeEnum } from "../enums/billing_invoice_type.enum";
7
7
  import { PaymentStatusEnum } from "../enums/payment_status.enum";
8
- import { IBillingEntity } from "../interface/billing.entity.interface";
9
8
  import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
10
9
  import { RelationConfigs } from "../interface/relation-config.interface";
11
10
  import { BankEntityModel } from "./bank.entity.model";
@@ -25,7 +24,7 @@ export declare enum BillingStatusCategoryEnumForUI {
25
24
  CLIENT_REVIEW_STATUS = "CLIENT_REVIEW_STATUS",
26
25
  PAYMENT_STATUS = "PAYMENT_STATUS"
27
26
  }
28
- export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLING> implements IBillingEntity {
27
+ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLING> implements IBillingApiEntity {
29
28
  id: number;
30
29
  startDate: string;
31
30
  endDate: string;
@@ -49,8 +48,8 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
49
48
  currency: CurrencyEnum;
50
49
  createdBy: number;
51
50
  updatedBy: number;
52
- createdOn: number;
53
- updatedOn: number;
51
+ createdOn: string;
52
+ updatedOn: string;
54
53
  type: BillingTypeEnum;
55
54
  project?: ProjectEntityModel;
56
55
  client?: ClientEntityModel;
@@ -69,7 +68,7 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
69
68
  EntityEnum.BILLING_TIMESHEET,
70
69
  EntityEnum.BANK
71
70
  ], EnumEntityType<EntityEnum.BILLING>>;
72
- static fromEntity(entity: IBillingEntity): BillingEntityModel;
71
+ static fromApiEntity(apiEntity: IBillingApiEntity): BillingEntityModel;
73
72
  getStatusCategory(): BillingStatusCategoryEnumForUI;
74
73
  getStatusLabel(): string;
75
74
  getTotalAmountInINR(): number;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BillingEntityModel = exports.BillingStatusCategoryEnumForUI = void 0;
4
4
  const enums_1 = require("../../enums");
5
- const utils_1 = require("../../utils");
6
5
  const billing_type_enum_1 = require("../enums/billing-type.enum");
7
6
  const billing_status_enum_1 = require("../enums/billing.status.enum");
8
7
  const billing_invoice_type_enum_1 = require("../enums/billing_invoice_type.enum");
@@ -40,14 +39,14 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
40
39
  this.currency = enums_1.CurrencyEnum.INR;
41
40
  this.createdBy = 0;
42
41
  this.updatedBy = 0;
43
- this.createdOn = 0;
44
- this.updatedOn = 0;
42
+ this.createdOn = "";
43
+ this.updatedOn = "";
45
44
  this.type = billing_type_enum_1.BillingTypeEnum.INVOICE;
46
45
  }
47
- static fromEntity(entity) {
48
- const result = new BillingEntityModel(entity_utils_interface_1.EntityEnum.BILLING);
49
- Object.assign(result, entity);
50
- return result;
46
+ static fromApiEntity(apiEntity) {
47
+ const entity = new BillingEntityModel(entity_utils_interface_1.EntityEnum.BILLING);
48
+ Object.assign(entity, apiEntity);
49
+ return entity;
51
50
  }
52
51
  getStatusCategory() {
53
52
  return this.mapStatusCategory(this.status);
@@ -64,7 +63,7 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
64
63
  return `${this.formatDate(this.startDate)} - ${this.formatDate(this.endDate, true)}`;
65
64
  }
66
65
  getBillDate() {
67
- return new Date((0, utils_1.epochToDateTime)(this.createdOn));
66
+ return new Date(this.createdOn);
68
67
  }
69
68
  mapOverdue(configValue) {
70
69
  var _a, _b, _c, _d;
@@ -52,7 +52,7 @@ function parseEntities(json, baseEntity, entityMap) {
52
52
  const entityFromJsonMappings = {
53
53
  [entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromEntity,
54
54
  [entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromEntity,
55
- [entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromEntity,
55
+ [entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromApiEntity,
56
56
  [entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
57
57
  [entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromEntity,
58
58
  [entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromApiEntity,
@@ -269,36 +269,5 @@ export declare function hasProperty<T extends object>(obj: T | null | undefined,
269
269
  * convertToNumberType("abc"); // throws Error("Invalid number: abc")
270
270
  */
271
271
  export declare function convertToNumberType<T extends string | number>(value: T): number;
272
- /**
273
- * Converts an epoch timestamp (in seconds) into a formatted date-time string.
274
- *
275
- * @param {number} epoch - The epoch timestamp in seconds (number of seconds since 1970-01-01 00:00:00 UTC).
276
- *
277
- * @returns {string} The formatted date-time string in "yyyy-MM-dd HH:mm:ss" format.
278
- *
279
- * @example
280
- * epochToDateTime(1759211965);
281
- * // Returns: "2025-09-30 11:19:25"
282
- *
283
- * @example
284
- * epochToDateTime(0);
285
- * // Returns: "1970-01-01 05:30:00" // if your system timezone is IST (UTC+5:30)
286
- */
287
272
  export declare function epochToDateTime(epoch: number): string;
288
- /**
289
- * Converts a JavaScript Date object into epoch seconds (UNIX timestamp).
290
- *
291
- * @param {Date} date - A JavaScript Date instance.
292
- *
293
- * @returns {number} The corresponding epoch time in seconds (number of seconds since 1970-01-01 00:00:00 UTC).
294
- *
295
- * @example
296
- * toEpochSeconds(new Date("2025-09-30 11:19:25"));
297
- * // Returns: 1759211965
298
- *
299
- * @example
300
- * toEpochSeconds(new Date());
301
- * // Returns: current epoch time in seconds
302
- */
303
- export declare function toEpochSeconds(date: Date): number;
304
273
  export declare function dateTimeToEpoch(dateInput: string | Date): number;
@@ -40,7 +40,6 @@ exports.getDecimalNumberFromString = getDecimalNumberFromString;
40
40
  exports.hasProperty = hasProperty;
41
41
  exports.convertToNumberType = convertToNumberType;
42
42
  exports.epochToDateTime = epochToDateTime;
43
- exports.toEpochSeconds = toEpochSeconds;
44
43
  exports.dateTimeToEpoch = dateTimeToEpoch;
45
44
  const date_fns_1 = require("date-fns");
46
45
  const util_constants_1 = require("../constants/util.constants");
@@ -568,43 +567,10 @@ function convertToNumberType(value) {
568
567
  }
569
568
  return num;
570
569
  }
571
- /**
572
- * Converts an epoch timestamp (in seconds) into a formatted date-time string.
573
- *
574
- * @param {number} epoch - The epoch timestamp in seconds (number of seconds since 1970-01-01 00:00:00 UTC).
575
- *
576
- * @returns {string} The formatted date-time string in "yyyy-MM-dd HH:mm:ss" format.
577
- *
578
- * @example
579
- * epochToDateTime(1759211965);
580
- * // Returns: "2025-09-30 11:19:25"
581
- *
582
- * @example
583
- * epochToDateTime(0);
584
- * // Returns: "1970-01-01 05:30:00" // if your system timezone is IST (UTC+5:30)
585
- */
586
570
  function epochToDateTime(epoch) {
587
571
  const date = new Date(epoch * 1000); // JS Date expects milliseconds
588
572
  return (0, date_fns_1.format)(date, "yyyy-MM-dd HH:mm:ss");
589
573
  }
590
- /**
591
- * Converts a JavaScript Date object into epoch seconds (UNIX timestamp).
592
- *
593
- * @param {Date} date - A JavaScript Date instance.
594
- *
595
- * @returns {number} The corresponding epoch time in seconds (number of seconds since 1970-01-01 00:00:00 UTC).
596
- *
597
- * @example
598
- * toEpochSeconds(new Date("2025-09-30 11:19:25"));
599
- * // Returns: 1759211965
600
- *
601
- * @example
602
- * toEpochSeconds(new Date());
603
- * // Returns: current epoch time in seconds
604
- */
605
- function toEpochSeconds(date) {
606
- return Math.floor(date.getTime() / 1000);
607
- }
608
574
  function dateTimeToEpoch(dateInput) {
609
575
  const date = typeof dateInput === "string" ? new Date(dateInput) : dateInput;
610
576
  return Math.floor(date.getTime() / 1000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.26.1-beta.4",
3
+ "version": "10.26.1-beta.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IBankHistoryEntity } from "../../entities";
2
- export type IBankHistoryApiEntity = IApiEntity<IBankHistoryEntity>;
3
- export type IBankHistoryApiEntityArray = IBankHistoryApiEntity[];
@@ -1,4 +0,0 @@
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[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IBillingHistoryEntity } from "../../entities";
2
- export type IBillingHistoryApiEntity = IApiEntity<IBillingHistoryEntity>;
3
- export type IBillingHistoryApiEntityArray = IBillingHistoryApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IBillingTimesheetHistoryEntity } from "../../entities";
2
- export type IBillingTimesheetHistoryApiEntity = IApiEntity<IBillingTimesheetHistoryEntity>;
3
- export type IBillingTimesheetHistoryApiEntityArray = IBillingTimesheetHistoryApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, ILeaveHistoryEntity } from "../../entities";
2
- export type ILeaveHistoryApiEntity = IApiEntity<ILeaveHistoryEntity>;
3
- export type ILeaveHistoryApiEntityArray = ILeaveHistoryApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IReimbursementHistoryEntity } from "../../entities";
2
- export type IReimbursementHistoryApiEntity = IApiEntity<IReimbursementHistoryEntity>;
3
- export type IReimbursementHistoryApiEntityArray = IReimbursementHistoryApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, ITimesheetHistoryEntity } from "../../entities";
2
- export type ITimesheetHistoryApiEntity = IApiEntity<ITimesheetHistoryEntity>;
3
- export type ITimesheetHistoryApiEntityArray = ITimesheetHistoryApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- import { IApiEntity } from "../../entities";
2
- import { IWorkFromHomeHistoryEntity } from "../../entities/interface/work_from_home_history.entity.interface";
3
- export type IWorkFromHomeHistoryApiEntity = IApiEntity<IWorkFromHomeHistoryEntity>;
4
- export type IWorkFromHomeHistoryApiEntityArray = IWorkFromHomeHistoryApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });