law-common 10.26.1-beta.0 → 10.26.1-beta.2

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.
@@ -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";
@@ -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);
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, IBillingEntity } from "../../entities";
2
+ export type IBillingApiEntity = IApiEntity<IBillingEntity>;
3
+ export type IBillingApiEntityArray = IBillingApiEntity[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  };
@@ -1,8 +1,6 @@
1
- import { IApiEntity, IReimbursementEntity, IReimbursementExpenseEntity, IUserEntity, ReimbursementActionEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementStatusEnum } from "../../entities";
1
+ import { IReimbursementEntity, IReimbursementExpenseEntity, IUserEntity, ReimbursementActionEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementStatusEnum } from "../../entities";
2
2
  import { IProjectEntityGet } from "./project.entity.response";
3
3
  import { IReimbursementExpenseApiEntityArray } from "./reimbursement_expense.api";
4
- export type IReimbursementApiEntity = IApiEntity<IReimbursementEntity>;
5
- export type IReimbursementApiEntityArray = IReimbursementApiEntity[];
6
4
  export type IReimbursementEntityGet = {
7
5
  reimbursements: IReimbursementResponse[];
8
6
  users: {
@@ -35,6 +33,6 @@ export type IReimbursementFlowConfig = {
35
33
  export type IReimbursementFlowContextData = {
36
34
  expenseDetails: IReimbursementExpenseEntity[];
37
35
  };
38
- export type IReimbursementResponse = IReimbursementApiEntity & {
36
+ export type IReimbursementResponse = IReimbursementEntity & {
39
37
  expenseDetails: IReimbursementExpenseApiEntityArray;
40
38
  };
@@ -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;
@@ -1,8 +1,8 @@
1
1
  import { ReimbursementActionEnum, ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum } from "../enums/reimbursement.entity.enum";
2
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
2
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
3
3
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
4
4
  import { IProjectUserMappingEntity } from "./project.entity.interface";
5
- export interface IReimbursementEntity extends IAuditColumnEntity {
5
+ export interface IReimbursementEntity extends IEntityAuditColumn {
6
6
  id: number;
7
7
  billingType: ReimbursementBillingTypeEnum;
8
8
  billDate: string;
@@ -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 fromApiEntity(entity: IBillingEntity): BillingEntityModel;
71
+ static fromApiEntity(apiEntity: IBillingApiEntity): BillingEntityModel;
73
72
  getStatusCategory(): BillingStatusCategoryEnumForUI;
74
73
  getStatusLabel(): string;
75
74
  getTotalAmountInINR(): number;
@@ -39,14 +39,14 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
39
39
  this.currency = enums_1.CurrencyEnum.INR;
40
40
  this.createdBy = 0;
41
41
  this.updatedBy = 0;
42
- this.createdOn = 0;
43
- this.updatedOn = 0;
42
+ this.createdOn = "";
43
+ this.updatedOn = "";
44
44
  this.type = billing_type_enum_1.BillingTypeEnum.INVOICE;
45
45
  }
46
- static fromApiEntity(entity) {
47
- const result = new BillingEntityModel(entity_utils_interface_1.EntityEnum.BILLING);
48
- Object.assign(result, entity);
49
- 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;
50
50
  }
51
51
  getStatusCategory() {
52
52
  return this.mapStatusCategory(this.status);
@@ -55,7 +55,7 @@ function parseEntities(json, baseEntity, entityMap) {
55
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
- [entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromApiEntity,
58
+ [entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromEntity,
59
59
  [entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.fromApiEntity,
60
60
  [entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.fromApiEntity,
61
61
  [entity_utils_interface_1.EntityEnum.CLIENT_AFFILIATE]: client_affiliate_entity_model_1.ClientAffiliateEntityModel.fromEntity,
@@ -1,8 +1,8 @@
1
- import { IReimbursementApiEntity } from "../../api";
2
1
  import { ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum } from "../enums/reimbursement.entity.enum";
3
2
  import { EntityEnum } from "../interface/entity.utils.interface";
3
+ import { IReimbursementEntity } from "../interface/reimbursement.entity.interface";
4
4
  import { BaseEntityModel } from "./base.entity.model";
5
- export declare class ReimbursementEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT> implements IReimbursementApiEntity {
5
+ export declare class ReimbursementEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT> implements IReimbursementEntity {
6
6
  id: number;
7
7
  billingType: ReimbursementBillingTypeEnum;
8
8
  billDate: string;
@@ -24,9 +24,9 @@ export declare class ReimbursementEntityModel extends BaseEntityModel<EntityEnum
24
24
  bankId?: number;
25
25
  createdBy: number;
26
26
  updatedBy: number;
27
- createdOn: string;
28
- updatedOn: string;
27
+ createdOn: number;
28
+ updatedOn: number;
29
29
  static relationConfigs: never[];
30
30
  getRelationConfigs(): any[];
31
- static fromApiEntity(apiEntity: IReimbursementApiEntity): ReimbursementEntityModel;
31
+ static fromEntity(entity: IReimbursementEntity): ReimbursementEntityModel;
32
32
  }
@@ -18,16 +18,16 @@ class ReimbursementEntityModel extends base_entity_model_1.BaseEntityModel {
18
18
  this.paymentStatus = reimbursement_entity_enum_1.ReimbursementPaymentStatusEnum.UNPAID;
19
19
  this.createdBy = 0;
20
20
  this.updatedBy = 0;
21
- this.createdOn = "";
22
- this.updatedOn = "";
21
+ this.createdOn = 0;
22
+ this.updatedOn = 0;
23
23
  }
24
24
  getRelationConfigs() {
25
25
  return this.constructor.prototype.constructor.relationConfigs || [];
26
26
  }
27
- static fromApiEntity(apiEntity) {
28
- const entity = new ReimbursementEntityModel(entity_utils_interface_1.EntityEnum.REIMBURSEMENT);
29
- Object.assign(entity, apiEntity);
30
- return entity;
27
+ static fromEntity(entity) {
28
+ const result = new ReimbursementEntityModel(entity_utils_interface_1.EntityEnum.REIMBURSEMENT);
29
+ Object.assign(result, entity);
30
+ return result;
31
31
  }
32
32
  }
33
33
  exports.ReimbursementEntityModel = ReimbursementEntityModel;
@@ -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.0",
3
+ "version": "10.26.1-beta.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [