law-common 11.0.1-beta.4 → 11.0.1

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/README.md CHANGED
@@ -1 +1 @@
1
- # law-common
1
+ # law-common
@@ -2,6 +2,5 @@ export declare enum BillingTransactionStatusEnum {
2
2
  APPROVED = "approved",
3
3
  REJECTED = "rejected",
4
4
  WRITEOFF_APPROVAL_PENDING = "writeoff_approval_pending",
5
- CREDITNOTE_APPROVAL_PENDING = "creditnote_approval_pending",
6
- ADJUST_AGAINST_CREDIT_NOTE_APPROVAL_PENDING = "adjust_against_credit_note_approval_pending"
5
+ CREDITNOTE_APPROVAL_PENDING = "creditnote_approval_pending"
7
6
  }
@@ -7,5 +7,4 @@ var BillingTransactionStatusEnum;
7
7
  BillingTransactionStatusEnum["REJECTED"] = "rejected";
8
8
  BillingTransactionStatusEnum["WRITEOFF_APPROVAL_PENDING"] = "writeoff_approval_pending";
9
9
  BillingTransactionStatusEnum["CREDITNOTE_APPROVAL_PENDING"] = "creditnote_approval_pending";
10
- BillingTransactionStatusEnum["ADJUST_AGAINST_CREDIT_NOTE_APPROVAL_PENDING"] = "adjust_against_credit_note_approval_pending";
11
10
  })(BillingTransactionStatusEnum || (exports.BillingTransactionStatusEnum = BillingTransactionStatusEnum = {}));
@@ -3,8 +3,7 @@ export declare enum BillingTransactionType {
3
3
  WRITE_OFF = "WRITE_OFF",
4
4
  CREDIT_NOTE = "CREDIT_NOTE",
5
5
  RECEIPT = "RECEIPT",
6
- REFUND = "REFUND",
7
- ADJUST_AGAINST_CREDIT_NOTE = "ADJUST_AGAINST_CREDIT_NOTE"
6
+ REFUND = "REFUND"
8
7
  }
9
8
  export declare namespace BillingTransactionType {
10
9
  function getNames(): string[];
@@ -10,7 +10,6 @@ var BillingTransactionType;
10
10
  BillingTransactionType["CREDIT_NOTE"] = "CREDIT_NOTE";
11
11
  BillingTransactionType["RECEIPT"] = "RECEIPT";
12
12
  BillingTransactionType["REFUND"] = "REFUND";
13
- BillingTransactionType["ADJUST_AGAINST_CREDIT_NOTE"] = "ADJUST_AGAINST_CREDIT_NOTE";
14
13
  })(BillingTransactionType || (exports.BillingTransactionType = BillingTransactionType = {}));
15
14
  (function (BillingTransactionType) {
16
15
  function getNames() {
@@ -45,22 +45,6 @@ exports.billingTransactionFlowConfig = {
45
45
  },
46
46
  },
47
47
  },
48
- [billing_transaction_status_enum_1.BillingTransactionStatusEnum.ADJUST_AGAINST_CREDIT_NOTE_APPROVAL_PENDING]: {
49
- actions: {
50
- [billing_transaction_action_enum_1.BillingTransactionActionEnum.APPROVE]: {
51
- permissions: ["BILLING_TRANSACTION_APPROVER_PROJECT", "BILLING_TRANSACTION_APPROVER_ORG"],
52
- next: () => billing_transaction_status_enum_1.BillingTransactionStatusEnum.APPROVED,
53
- },
54
- [billing_transaction_action_enum_1.BillingTransactionActionEnum.REJECT]: {
55
- permissions: ["BILLING_TRANSACTION_APPROVER_PROJECT", "BILLING_TRANSACTION_APPROVER_ORG"],
56
- next: () => billing_transaction_status_enum_1.BillingTransactionStatusEnum.REJECTED,
57
- },
58
- [billing_transaction_action_enum_1.BillingTransactionActionEnum.EDIT]: {
59
- permissions: ["BILLING_TRANSACTION_UPDATE_SELF"],
60
- next: (data) => decideNextStatus(data),
61
- },
62
- },
63
- },
64
48
  };
65
49
  function decideNextStatus(data) {
66
50
  var _a;
@@ -68,7 +52,6 @@ function decideNextStatus(data) {
68
52
  const typeStatusMapping = {
69
53
  [billing_transaction_enum_1.BillingTransactionType.WRITE_OFF]: billing_transaction_status_enum_1.BillingTransactionStatusEnum.WRITEOFF_APPROVAL_PENDING,
70
54
  [billing_transaction_enum_1.BillingTransactionType.CREDIT_NOTE]: billing_transaction_status_enum_1.BillingTransactionStatusEnum.CREDITNOTE_APPROVAL_PENDING,
71
- [billing_transaction_enum_1.BillingTransactionType.ADJUST_AGAINST_CREDIT_NOTE]: billing_transaction_status_enum_1.BillingTransactionStatusEnum.ADJUST_AGAINST_CREDIT_NOTE_APPROVAL_PENDING,
72
55
  };
73
56
  if (currentBillingTransactionEntity.type === dto.type) {
74
57
  return currentBillingTransactionEntity.status;
@@ -1,7 +1,7 @@
1
1
  import { BillingTransactionStatusEnum } from "../enums/billing-transaction-status.enum";
2
2
  import { BillingTransactionType } from "../enums/billing.transaction.enum";
3
3
  import { IEntityAuditColumn } from "./entity-audit-columns.interface";
4
- import { IEntityFilterData, Nullable } from "./entity.utils.interface";
4
+ import { IEntityFilterData } from "./entity.utils.interface";
5
5
  export interface IBillingTransactionEntity extends IEntityAuditColumn {
6
6
  id: number;
7
7
  billingId: number;
@@ -12,7 +12,7 @@ export interface IBillingTransactionEntity extends IEntityAuditColumn {
12
12
  bankCharges?: number;
13
13
  bankId?: number;
14
14
  paymentDate?: string;
15
- referenceNo?: Nullable<string>;
15
+ referenceNo?: string;
16
16
  supportingDocsUrls?: string;
17
17
  status: BillingTransactionStatusEnum;
18
18
  }
@@ -47,10 +47,10 @@ class BaseEntityModel {
47
47
  }
48
48
  }
49
49
  if (foundRelatedEntities.length > 1) {
50
- throw new Error(`[populateRelationsByIndex]. Entity ${this.entityName} - Expected one related entity for ${relationConfig.name} but found ${foundRelatedEntities.length}`);
50
+ throw new Error(`Expected one related entity for ${relationConfig.name} but found ${foundRelatedEntities.length}`);
51
51
  }
52
52
  if (foundRelatedEntities.length === 0) {
53
- console.warn(`[populateRelationsByIndex]. Entity ${this.entityName} - No related entity found for ${relationConfig.name} with ${thisMappingKey}=${this[relationConfig.mapKeyConfig.foreignKey]}`);
53
+ console.warn(`No related entity found for ${relationConfig.name} with ${thisMappingKey}=${this[relationConfig.mapKeyConfig.foreignKey]}`);
54
54
  }
55
55
  this[thisKey] = foundRelatedEntities[0];
56
56
  }
@@ -1,8 +1,7 @@
1
- import { CurrencyEnum } from "../../enums";
2
1
  import { BillingTransactionStatusEnum } from "../enums/billing-transaction-status.enum";
3
2
  import { BillingTransactionType } from "../enums/billing.transaction.enum";
4
3
  import { IBillingTransactionEntity } from "../interface/billing_transaction.entity.interface";
5
- import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
4
+ import { EntityEnum } from "../interface/entity.utils.interface";
6
5
  import { RelationConfigs } from "../interface/relation-config.interface";
7
6
  import { BankEntityModel } from "./bank.entity.model";
8
7
  import { BaseEntityModel } from "./base.entity.model";
@@ -18,7 +17,7 @@ export declare class BillingTransactionEntityModel extends BaseEntityModel<Entit
18
17
  bankCharges?: number;
19
18
  bankId?: number;
20
19
  paymentDate?: string;
21
- referenceNo?: Nullable<string>;
20
+ referenceNo?: string;
22
21
  supportingDocsUrls?: string;
23
22
  status: BillingTransactionStatusEnum;
24
23
  createdOn: number;
@@ -33,8 +32,4 @@ export declare class BillingTransactionEntityModel extends BaseEntityModel<Entit
33
32
  static relationConfigs: RelationConfigs<[EntityEnum.USER, EntityEnum.USER, EntityEnum.BANK, EntityEnum.BILLING], EntityEnum.BILLING_TRANSACTION>;
34
33
  static fromEntity(entity: IBillingTransactionEntity): BillingTransactionEntityModel;
35
34
  static sumAmounts(transactions: BillingTransactionEntityModel[]): number;
36
- get isForeignCurrencyTransaction(): boolean;
37
- get transactionCurrency(): CurrencyEnum;
38
- getFileName(): string;
39
- get isBillingSettled(): boolean;
40
35
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BillingTransactionEntityModel = void 0;
4
4
  const utils_1 = require("../../utils");
5
5
  const billing_transaction_status_enum_1 = require("../enums/billing-transaction-status.enum");
6
- const billing_status_enum_1 = require("../enums/billing.status.enum");
7
6
  const billing_transaction_enum_1 = require("../enums/billing.transaction.enum");
8
7
  const relation_type_enum_1 = require("../enums/relation-type.enum");
9
8
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
@@ -41,26 +40,6 @@ class BillingTransactionEntityModel extends base_entity_model_1.BaseEntityModel
41
40
  });
42
41
  }), "amount");
43
42
  }
44
- get isForeignCurrencyTransaction() {
45
- var _a, _b;
46
- return (_b = (_a = this.billing) === null || _a === void 0 ? void 0 : _a.isForeignBilling) !== null && _b !== void 0 ? _b : false;
47
- }
48
- get transactionCurrency() {
49
- var _a, _b;
50
- return (_b = (_a = this.billing) === null || _a === void 0 ? void 0 : _a.currency) !== null && _b !== void 0 ? _b : "";
51
- }
52
- getFileName() {
53
- var _a, _b, _c, _d, _e, _f;
54
- const { dateCode, timeCode } = utils_1.DateCodeModel.getCurrentISTDateTimeCode();
55
- const invoiceNo = (_b = (_a = this.billing) === null || _a === void 0 ? void 0 : _a.invoiceNumber) !== null && _b !== void 0 ? _b : "";
56
- const clientName = ((_d = (_c = this.billing) === null || _c === void 0 ? void 0 : _c.clientName) !== null && _d !== void 0 ? _d : "").replace(/ /g, "_");
57
- const projectName = ((_f = (_e = this.billing) === null || _e === void 0 ? void 0 : _e.projectName) !== null && _f !== void 0 ? _f : "").replace(/ /g, "_");
58
- return `${this.type}_${invoiceNo}_${clientName}_${projectName}_${dateCode}_${timeCode}`;
59
- }
60
- get isBillingSettled() {
61
- var _a;
62
- return ((_a = this.billing) === null || _a === void 0 ? void 0 : _a.status) === billing_status_enum_1.BillingStatusEnum.SETTLED;
63
- }
64
43
  }
65
44
  exports.BillingTransactionEntityModel = BillingTransactionEntityModel;
66
45
  BillingTransactionEntityModel.relationConfigs = [
@@ -8,7 +8,6 @@ import { BillingTypeEnum } from "../enums/billing-type.enum";
8
8
  import { BillingActionsEnum } from "../enums/billing.action.enum";
9
9
  import { BillingStatusEnum } from "../enums/billing.status.enum";
10
10
  import { BillingInvoiceTypeEnum } from "../enums/billing_invoice_type.enum";
11
- import { BillingProfileCode } from "../enums/billing_profile_code.enum";
12
11
  import { BillingInvoiceNumberPrefixEnum } from "../enums/invoice-number-prefix.enum";
13
12
  import { PaymentStatusEnum } from "../enums/payment_status.enum";
14
13
  import { IBillingEntity } from "../interface/billing.entity.interface";
@@ -157,9 +156,4 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
157
156
  get isForeignCurrencyProject(): boolean;
158
157
  get isProformaInvoice(): boolean;
159
158
  get title(): BillingTemplateTitle;
160
- get billingProfileName(): string;
161
- get billingProfileCode(): BillingProfileCode;
162
- get poNumber(): Nullable<string>;
163
- get creditNoteTransactions(): BillingTransactionEntityModel[] | undefined;
164
- get adjustedCreditNoteTransactions(): BillingTransactionEntityModel[] | undefined;
165
159
  }
@@ -12,8 +12,6 @@ const billing_type_enum_1 = require("../enums/billing-type.enum");
12
12
  const billing_status_enum_1 = require("../enums/billing.status.enum");
13
13
  const billing_transaction_enum_1 = require("../enums/billing.transaction.enum");
14
14
  const billing_invoice_type_enum_1 = require("../enums/billing_invoice_type.enum");
15
- const billing_profile_enum_1 = require("../enums/billing_profile.enum");
16
- const billing_profile_code_enum_1 = require("../enums/billing_profile_code.enum");
17
15
  const invoice_number_prefix_enum_1 = require("../enums/invoice-number-prefix.enum");
18
16
  const payment_status_enum_1 = require("../enums/payment_status.enum");
19
17
  const relation_type_enum_1 = require("../enums/relation-type.enum");
@@ -453,23 +451,6 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
453
451
  ? constants_1.BillingTemplateTitle.DRAFT_INVOICE
454
452
  : constants_1.BillingTemplateTitle.INVOICE;
455
453
  }
456
- get billingProfileName() {
457
- return this.billingProfileParticulars.name;
458
- }
459
- get billingProfileCode() {
460
- return this.billingProfileName === billing_profile_enum_1.BillingProfileName.AGRAM_LEGAL_CONSULTANTS ? billing_profile_code_enum_1.BillingProfileCode.ALC : billing_profile_code_enum_1.BillingProfileCode.ALP;
461
- }
462
- get poNumber() {
463
- return this.billingProfileParticulars.poNumber;
464
- }
465
- get creditNoteTransactions() {
466
- var _a;
467
- return (_a = this.billingTransactions) === null || _a === void 0 ? void 0 : _a.filter((transaction) => transaction.type === billing_transaction_enum_1.BillingTransactionType.CREDIT_NOTE);
468
- }
469
- get adjustedCreditNoteTransactions() {
470
- var _a;
471
- return (_a = this.billingTransactions) === null || _a === void 0 ? void 0 : _a.filter((transaction) => transaction.type === billing_transaction_enum_1.BillingTransactionType.ADJUST_AGAINST_CREDIT_NOTE);
472
- }
473
454
  }
474
455
  exports.BillingEntityModel = BillingEntityModel;
475
456
  BillingEntityModel.BILLING_ENTITY_DOCUMENT_TYPES = ["invoice"];
@@ -71,16 +71,4 @@ export declare class ClientEntityModel extends BaseEntityModel<EntityEnum.CLIENT
71
71
  * - Err with validation errors if any rule is violated
72
72
  */
73
73
  static validateDocumentNoDocumentFile(data: DocumentFields<typeof ClientEntityModel.CLIENT_ENTITY_DOCUMENT_TYPES>, deleteDetails?: DeleteDocumentDetails<typeof ClientEntityModel.CLIENT_ENTITY_DOCUMENT_TYPES>): Result<void, IDtoValidationError[]>;
74
- get gstNo(): string;
75
- private get parsedAddress();
76
- get addressLineOne(): string;
77
- get addressLineTwo(): string;
78
- get city(): string;
79
- get state(): string;
80
- getBillingsFromProfileCode(billingProfileCode?: string): import("./billing.entity.model").BillingEntityModel[];
81
- getCreditNoteTransactions(billingProfileCode?: string): import("./billing-transaction.model").BillingTransactionEntityModel[];
82
- getAdjustedCreditNoteTransactions(billingProfileCode?: string): import("./billing-transaction.model").BillingTransactionEntityModel[];
83
- get totalCreditNoteAmount(): number;
84
- get totalCreditNoteAmountAdjusted(): number;
85
- get totalCreditNoteAmountPendingForAdjustment(): number;
86
74
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ClientEntityModel = void 0;
4
- const utils_1 = require("../../utils");
5
4
  const code_util_1 = require("../../utils/code.util");
6
5
  const document_validate_util_1 = require("../../utils/document-validate.util");
7
6
  const relation_type_enum_1 = require("../enums/relation-type.enum");
@@ -75,58 +74,6 @@ class ClientEntityModel extends base_entity_model_1.BaseEntityModel {
75
74
  static validateDocumentNoDocumentFile(data, deleteDetails) {
76
75
  return (0, document_validate_util_1.validateDocumentPairs)(ClientEntityModel.CLIENT_ENTITY_DOCUMENT_TYPES, data, deleteDetails);
77
76
  }
78
- get gstNo() {
79
- var _a;
80
- return (_a = this.gstNumber) !== null && _a !== void 0 ? _a : "";
81
- }
82
- get parsedAddress() {
83
- if (!this.address)
84
- return null;
85
- try {
86
- return JSON.parse(this.address);
87
- }
88
- catch (_a) {
89
- return null;
90
- }
91
- }
92
- get addressLineOne() {
93
- var _a, _b;
94
- return (_b = (_a = this.parsedAddress) === null || _a === void 0 ? void 0 : _a.addressLine1) !== null && _b !== void 0 ? _b : "";
95
- }
96
- get addressLineTwo() {
97
- var _a, _b;
98
- return (_b = (_a = this.parsedAddress) === null || _a === void 0 ? void 0 : _a.addressLine2) !== null && _b !== void 0 ? _b : "";
99
- }
100
- get city() {
101
- var _a, _b;
102
- return (_b = (_a = this.parsedAddress) === null || _a === void 0 ? void 0 : _a.city) !== null && _b !== void 0 ? _b : "";
103
- }
104
- get state() {
105
- var _a, _b;
106
- return (_b = (_a = this.parsedAddress) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : "";
107
- }
108
- getBillingsFromProfileCode(billingProfileCode) {
109
- return this.projects.flatMap((project) => { var _a; return (_a = project.billings) !== null && _a !== void 0 ? _a : []; }).filter((billing) => billing.billingProfileCode === billingProfileCode);
110
- }
111
- getCreditNoteTransactions(billingProfileCode) {
112
- return this.getBillingsFromProfileCode(billingProfileCode).flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
113
- }
114
- getAdjustedCreditNoteTransactions(billingProfileCode) {
115
- return this.getBillingsFromProfileCode(billingProfileCode).flatMap((billing) => { var _a; return (_a = billing.adjustedCreditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
116
- }
117
- get totalCreditNoteAmount() {
118
- const creditNoteTransactions = this.projects.flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; }).flatMap((billing) => { var _a; return (_a = billing.creditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
119
- return (0, utils_1.sumNormalised)(creditNoteTransactions, "amount");
120
- }
121
- get totalCreditNoteAmountAdjusted() {
122
- const adjustedTransactions = this.projects
123
- .flatMap((project) => { var _a; return (_a = project.settledBillings) !== null && _a !== void 0 ? _a : []; })
124
- .flatMap((billing) => { var _a; return (_a = billing.adjustedCreditNoteTransactions) !== null && _a !== void 0 ? _a : []; });
125
- return (0, utils_1.sumNormalised)(adjustedTransactions, "amount");
126
- }
127
- get totalCreditNoteAmountPendingForAdjustment() {
128
- return this.totalCreditNoteAmount - this.totalCreditNoteAmountAdjusted;
129
- }
130
77
  }
131
78
  exports.ClientEntityModel = ClientEntityModel;
132
79
  ClientEntityModel.CLIENT_ENTITY_DOCUMENT_TYPES = ["pan", "tan", "gst"];
@@ -5,7 +5,6 @@ import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
5
5
  import { IProjectEntity, IProjectUserDto, UsageNotificationThresholdEnum } from "../interface/project.entity.interface";
6
6
  import { RelationConfigs } from "../interface/relation-config.interface";
7
7
  import { BaseEntityModel } from "./base.entity.model";
8
- import { BillingEntityModel } from "./billing.entity.model";
9
8
  import { ClientEntityModel } from "./client.entity.model";
10
9
  import { ProjectUserMappingEntityModel } from "./project-user-mapping.entity.model";
11
10
  import { UserEntityModel } from "./user.entity.model";
@@ -35,11 +34,10 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
35
34
  userMappings?: (UserEntityModel & ProjectUserMappingEntityModel)[];
36
35
  projectUserMappings?: ProjectUserMappingEntityModel[];
37
36
  client: ClientEntityModel;
38
- billings?: BillingEntityModel[];
39
37
  static fromEntity(entity: IProjectEntity): ProjectEntityModel;
40
- static relationConfigs: RelationConfigs<[EntityEnum.PROJECT_USER_MAPPING, EntityEnum.BILLING, EntityEnum.CLIENT], EntityEnum.PROJECT>;
38
+ static relationConfigs: RelationConfigs<[EntityEnum.PROJECT_USER_MAPPING, EntityEnum.CLIENT], EntityEnum.PROJECT>;
41
39
  populateUsers(users: UserEntityModel[], projectUserMapping: ProjectUserMappingEntityModel[]): void;
42
- getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.BILLING, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.CLIENT, EntityEnum.PROJECT>];
40
+ getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.CLIENT, EntityEnum.PROJECT>];
43
41
  isForeignCurrencyProjoect(): boolean;
44
42
  get parsedBillingRate(): any;
45
43
  isHourlyProject(): boolean;
@@ -47,7 +45,4 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
47
45
  isAdhocProject(): boolean;
48
46
  get partnersOwnerUsersOfProject(): UserEntityModel[];
49
47
  get clientName(): string;
50
- get clientGSTNumber(): string;
51
- get clientVendorCode(): string;
52
- get settledBillings(): BillingEntityModel[] | undefined;
53
48
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProjectEntityModel = void 0;
4
4
  const enums_1 = require("../../enums");
5
- const billing_status_enum_1 = require("../enums/billing.status.enum");
6
5
  const project_revenue_split_enum_1 = require("../enums/project-revenue-split.enum");
7
6
  const project_entity_enum_1 = require("../enums/project.entity.enum");
8
7
  const relation_type_enum_1 = require("../enums/relation-type.enum");
@@ -30,7 +29,6 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
30
29
  this.clientQuoteId = null;
31
30
  this.users = [];
32
31
  this.client = {};
33
- this.billings = [];
34
32
  }
35
33
  static fromEntity(entity) {
36
34
  const result = new ProjectEntityModel(entity_utils_interface_1.EntityEnum.PROJECT);
@@ -114,17 +112,6 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
114
112
  get clientName() {
115
113
  return this.client.name;
116
114
  }
117
- get clientGSTNumber() {
118
- return this.client.gstNo;
119
- }
120
- get clientVendorCode() {
121
- var _a;
122
- return (_a = this.client.vendorCode) !== null && _a !== void 0 ? _a : "";
123
- }
124
- get settledBillings() {
125
- var _a;
126
- return (_a = this.billings) === null || _a === void 0 ? void 0 : _a.filter((billing) => billing.status === billing_status_enum_1.BillingStatusEnum.SETTLED);
127
- }
128
115
  }
129
116
  exports.ProjectEntityModel = ProjectEntityModel;
130
117
  ProjectEntityModel.relationConfigs = [
@@ -137,15 +124,6 @@ ProjectEntityModel.relationConfigs = [
137
124
  key: "id",
138
125
  },
139
126
  },
140
- {
141
- name: entity_utils_interface_1.EntityEnum.BILLING,
142
- relation: relation_type_enum_1.RelationType.MANY,
143
- key: "billings",
144
- mapKeyConfig: {
145
- relationKey: "projectId",
146
- key: "id",
147
- },
148
- },
149
127
  {
150
128
  name: entity_utils_interface_1.EntityEnum.CLIENT,
151
129
  relation: relation_type_enum_1.RelationType.ONE,
@@ -88,8 +88,4 @@ export declare class DateCodeModel {
88
88
  max: string | null;
89
89
  };
90
90
  toStringFormat(dateFormat: string): string;
91
- static getCurrentISTDateTimeCode(): {
92
- dateCode: string;
93
- timeCode: string;
94
- };
95
91
  }
@@ -372,14 +372,5 @@ class DateCodeModel {
372
372
  toStringFormat(dateFormat) {
373
373
  return (0, date_fns_1.format)(this.getDate(), dateFormat);
374
374
  }
375
- static getCurrentISTDateTimeCode() {
376
- const now = new Date();
377
- const istOffsetMs = 5.5 * 60 * 60 * 1000;
378
- const nowIST = new Date(now.getTime() + istOffsetMs);
379
- return {
380
- dateCode: (0, date_fns_1.format)(nowIST, "ddMMyyyy"),
381
- timeCode: (0, date_fns_1.format)(nowIST, "HHmmss"),
382
- };
383
- }
384
375
  }
385
376
  exports.DateCodeModel = DateCodeModel;
package/package.json CHANGED
@@ -1,42 +1,44 @@
1
- {
2
- "name": "law-common",
3
- "version": "11.0.1-beta.4",
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 && npm run link",
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
- "format": "prettier --write .",
19
- "check-format": "prettier --check .",
20
- "pull:link": "git pull && npm run link",
21
- "check-version": "npm view law-common versions --json | jq -r '.[-1]'"
22
- },
23
- "keywords": [],
24
- "author": "",
25
- "license": "ISC",
26
- "devDependencies": {
27
- "@types/jest": "^29.5.13",
28
- "@types/lodash": "^4.17.21",
29
- "@types/node": "^22.6.1",
30
- "jest": "^29.7.0",
31
- "prettier": "3.8.1",
32
- "ts-jest": "^29.2.5",
33
- "ts-node": "^10.9.2",
34
- "typescript": "^5.6.2"
35
- },
36
- "dependencies": {
37
- "@types/express": "^5.0.0",
38
- "@types/multer": "^1.4.12",
39
- "date-fns": "^4.1.0",
40
- "lodash": "4.17.21"
41
- }
42
- }
1
+ {
2
+ "name": "law-common",
3
+ "version": "11.0.1",
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 && npm run link",
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
+ "format": "prettier --write .",
19
+ "check-format": "prettier --check .",
20
+ "pull:link": "git pull && npm run link",
21
+ "check-version": "npm view law-common versions --json | jq -r '.[-1]'",
22
+ "publish": "node scripts/publish.js",
23
+ "publish:latest:beta": "node scripts/publish.js prerelease beta && git push && npm run build && npm publish --tag beta && npm run link"
24
+ },
25
+ "keywords": [],
26
+ "author": "",
27
+ "license": "ISC",
28
+ "devDependencies": {
29
+ "@types/jest": "^29.5.13",
30
+ "@types/lodash": "^4.17.21",
31
+ "@types/node": "^22.6.1",
32
+ "jest": "^29.7.0",
33
+ "prettier": "3.8.1",
34
+ "ts-jest": "^29.2.5",
35
+ "ts-node": "^10.9.2",
36
+ "typescript": "^5.6.2"
37
+ },
38
+ "dependencies": {
39
+ "@types/express": "^5.0.0",
40
+ "@types/multer": "^1.4.12",
41
+ "date-fns": "^4.1.0",
42
+ "lodash": "4.17.21"
43
+ }
44
+ }