law-common 10.66.1 → 10.67.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/README.md CHANGED
@@ -1 +1 @@
1
- # law-common
1
+ # law-common
@@ -1,4 +1,4 @@
1
- import { BillingImpactEnum, BillingReimbursementExpenseChangedStatusEnum, BillingStatusEnum, IBillingEntity, IBillingTimesheetEntity, IEntityCreateDto, IProjectEntity, ITimesheetEntity, Nullable } from "../../entities";
1
+ import { BillingImpactEnum, BillingReimbursementExpenseChangedStatusEnum, BillingStatusEnum, IBillingEntity, IBillingProfileEntity, IBillingTimesheetEntity, IEntityCreateDto, IProjectEntity, ITimesheetEntity, Nullable } from "../../entities";
2
2
  import { IAppFileConfig } from "../../misc";
3
3
  export type IBillingCreateExclude = "paymentStatus" | "status" | "writeoffAmount" | "tdsAmount" | "totalAmountPaid" | "creditNoteAmount" | "refundAmount" | "invoicePdfUrl" | "startDate" | "endDate" | "invoiceNumber" | "draftInvoiceNumber";
4
4
  export interface IBillingCreateDto extends Omit<IEntityCreateDto<IBillingEntity>, IBillingCreateExclude | "particulars"> {
@@ -17,6 +17,7 @@ export interface IBillingParticulars {
17
17
  includePONumber: 0 | 1;
18
18
  includeGSTNumber: 0 | 1;
19
19
  poNumber: Nullable<string>;
20
+ name: string;
20
21
  }
21
22
  export interface IBillingCreateDtoExtra {
22
23
  particulars: IBillingParticulars[];
@@ -45,6 +46,7 @@ export interface IBillingEntityCreateDtoValidationData {
45
46
  projectEntity: IProjectEntity;
46
47
  billingTimesheetEntities: IBillingTimesheetEntity[];
47
48
  timesheetEntities: ITimesheetEntity[];
49
+ billingProfileEntity: IBillingProfileEntity;
48
50
  }
49
51
  export interface IBillingReimbursementExpenseCreateDtoDetails {
50
52
  userId: number;
@@ -1,4 +1,4 @@
1
- import { BillingActionsEnum, IBillingEntity, IBillingReimbursementExpenseUpdateDto, IBillingTimesheetUpdateDto, IEntityUpdateDto } from "../../entities";
1
+ import { BillingActionsEnum, IBillingEntity, IBillingProfileEntity, IBillingReimbursementExpenseUpdateDto, IBillingTimesheetUpdateDto, IEntityUpdateDto } from "../../entities";
2
2
  import { IBillingEntityCreateDtoValidationData, IBillingParticulars } from "./billing.create.dto.interface";
3
3
  export type IBillingUpdateDtoExclude = "draftInvoiceNumber" | "invoiceNumber";
4
4
  export interface IBillingUpdateDto extends Omit<IEntityUpdateDto<IBillingEntity>, IBillingUpdateDtoExclude> {
@@ -11,4 +11,5 @@ export interface IUpdateBillingDto extends Omit<IBillingUpdateDto, "particulars"
11
11
  }
12
12
  export interface IBillingUpdateDtoValidationData extends IBillingEntityCreateDtoValidationData {
13
13
  billingEntity: IBillingEntity;
14
+ billingProfileEntity: IBillingProfileEntity;
14
15
  }
@@ -0,0 +1,4 @@
1
+ export declare enum BillingProfileName {
2
+ AGRAM_LEGAL_CONSULTANTS = "AGRAM LEGAL CONSULTANTS",
3
+ AGRAM_LEGAL_PARTNERS = "AGRAM LEGAL PARTNERS"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingProfileName = void 0;
4
+ var BillingProfileName;
5
+ (function (BillingProfileName) {
6
+ BillingProfileName["AGRAM_LEGAL_CONSULTANTS"] = "AGRAM LEGAL CONSULTANTS";
7
+ BillingProfileName["AGRAM_LEGAL_PARTNERS"] = "AGRAM LEGAL PARTNERS";
8
+ })(BillingProfileName || (exports.BillingProfileName = BillingProfileName = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum BillingProfileCode {
2
+ ALC = "ALC",
3
+ ALP = "ALP"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingProfileCode = void 0;
4
+ var BillingProfileCode;
5
+ (function (BillingProfileCode) {
6
+ BillingProfileCode["ALC"] = "ALC";
7
+ BillingProfileCode["ALP"] = "ALP";
8
+ })(BillingProfileCode || (exports.BillingProfileCode = BillingProfileCode = {}));
@@ -1,5 +1,5 @@
1
1
  export declare enum BillingInvoiceNumberPrefixEnum {
2
- DRAFT = "ALC-D",
3
- PROFORMA = "ALC-P",
4
- INVOICE = "ALC-"
2
+ DRAFT = "-D",
3
+ PROFORMA = "-P",
4
+ INVOICE = "-"
5
5
  }
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BillingInvoiceNumberPrefixEnum = void 0;
4
- const constants_1 = require("../../constants");
5
4
  var BillingInvoiceNumberPrefixEnum;
6
5
  (function (BillingInvoiceNumberPrefixEnum) {
7
- BillingInvoiceNumberPrefixEnum["DRAFT"] = "ALC-D";
8
- BillingInvoiceNumberPrefixEnum["PROFORMA"] = "ALC-P";
9
- BillingInvoiceNumberPrefixEnum["INVOICE"] = "ALC-";
6
+ BillingInvoiceNumberPrefixEnum["DRAFT"] = "-D";
7
+ BillingInvoiceNumberPrefixEnum["PROFORMA"] = "-P";
8
+ BillingInvoiceNumberPrefixEnum["INVOICE"] = "-";
10
9
  })(BillingInvoiceNumberPrefixEnum || (exports.BillingInvoiceNumberPrefixEnum = BillingInvoiceNumberPrefixEnum = {}));
@@ -179,3 +179,7 @@ export * from "./interface/client_quote.entity.interface";
179
179
  export * from "./interface/client_quote_rate.entity.interface";
180
180
  export * from "./model/client_quote.entity.model";
181
181
  export * from "./model/client_quote_rate.entity.model";
182
+ export * from "./enums/billing_profile.enum";
183
+ export * from "./enums/billing_profile_code.enum";
184
+ export * from "./interface/billing_profile.entity.interface";
185
+ export * from "./model/billing-profile.entity.model";
@@ -195,3 +195,7 @@ __exportStar(require("./interface/client_quote.entity.interface"), exports);
195
195
  __exportStar(require("./interface/client_quote_rate.entity.interface"), exports);
196
196
  __exportStar(require("./model/client_quote.entity.model"), exports);
197
197
  __exportStar(require("./model/client_quote_rate.entity.model"), exports);
198
+ __exportStar(require("./enums/billing_profile.enum"), exports);
199
+ __exportStar(require("./enums/billing_profile_code.enum"), exports);
200
+ __exportStar(require("./interface/billing_profile.entity.interface"), exports);
201
+ __exportStar(require("./model/billing-profile.entity.model"), exports);
@@ -0,0 +1,10 @@
1
+ import { BillingProfileName } from "../enums/billing_profile.enum";
2
+ import { BillingProfileCode } from "../enums/billing_profile_code.enum";
3
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
4
+ export interface IBillingProfileEntity extends IEntityAuditColumn {
5
+ id: number;
6
+ name: BillingProfileName;
7
+ logoFilePath: string;
8
+ pan: string;
9
+ code: BillingProfileCode;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,6 +7,7 @@ import { HistoryOperationEnum } from "../enums/history_operation.enum";
7
7
  import { AddressBookEntityModel } from "../model/address_book.model";
8
8
  import { BankEntityModel } from "../model/bank.entity.model";
9
9
  import { BankHistoryEntityModel } from "../model/bank_history.entity.model";
10
+ import { BillingProfileEntityModel } from "../model/billing-profile.entity.model";
10
11
  import { BillingReimbursementExpenseHistoryEntityModel } from "../model/billing-reimbursement-expense-history.entity.model";
11
12
  import { BillingReimbursementExpneseEntityModel } from "../model/billing-reimbursement-expense.entity.model";
12
13
  import { BillingTimesheetEntityModel } from "../model/billing-timesheet.entity.model";
@@ -78,6 +79,7 @@ import { IBillingTransactionHistoryEntity } from "./billing-transaction-history.
78
79
  import { IBillingEntity } from "./billing.entity.interface";
79
80
  import { IBillingHistoryEntity } from "./billing_history.entity.interface";
80
81
  import { IBillingPaymentEntity } from "./billing_payment.entity.interface";
82
+ import { IBillingProfileEntity } from "./billing_profile.entity.interface";
81
83
  import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
82
84
  import { IBillingTimesheetHistoryEntity } from "./billing_timesheet_history.entity.interface";
83
85
  import { IBillingTransactionEntity } from "./billing_transaction.entity.interface";
@@ -233,7 +235,8 @@ export declare enum EntityEnum {
233
235
  VENDOR_INVOICE_ITEM_HISTORY = "vendor_invoice_item_history",
234
236
  VENDOR_HISTORY = "vendor_history",
235
237
  CLIENT_QUOTE = "client_quote",
236
- CLIENT_QUOTE_RATE = "client_quote_rate"
238
+ CLIENT_QUOTE_RATE = "client_quote_rate",
239
+ BILLING_PROFILE = "billing_profile"
237
240
  }
238
241
  export type EntityRelations = {
239
242
  [K in EntityEnum | VirtualEntityEnum]: K;
@@ -252,7 +255,7 @@ export type IBaseEntityApiResponse<T> = {
252
255
  [K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
253
256
  };
254
257
  };
255
- export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : 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.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : 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.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : 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.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : never) & {
258
+ export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : 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.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : 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.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : 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.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.BILLING_PROFILE ? IBillingProfileEntity : never) & {
256
259
  id: number;
257
260
  };
258
261
  export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
@@ -376,7 +379,7 @@ export declare enum VirtualEntityEnum {
376
379
  }
377
380
  export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
378
381
  export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
379
- export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.BILLING_PAYMENT ? BillingPaymentEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : UserEntityModel;
382
+ export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.BILLING_PAYMENT ? BillingPaymentEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.BILLING_PROFILE ? BillingProfileEntityModel : UserEntityModel;
380
383
  export type EntityMap = {
381
384
  [key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
382
385
  };
@@ -97,6 +97,7 @@ var EntityEnum;
97
97
  EntityEnum["VENDOR_HISTORY"] = "vendor_history";
98
98
  EntityEnum["CLIENT_QUOTE"] = "client_quote";
99
99
  EntityEnum["CLIENT_QUOTE_RATE"] = "client_quote_rate";
100
+ EntityEnum["BILLING_PROFILE"] = "billing_profile";
100
101
  })(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
101
102
  var VirtualEntityEnum;
102
103
  (function (VirtualEntityEnum) {
@@ -0,0 +1,19 @@
1
+ import { BillingProfileName } from "../enums/billing_profile.enum";
2
+ import { BillingProfileCode } from "../enums/billing_profile_code.enum";
3
+ import { IBillingProfileEntity } from "../interface/billing_profile.entity.interface";
4
+ import { EntityEnum } from "../interface/entity.utils.interface";
5
+ import { BaseEntityModel } from "./base.entity.model";
6
+ export declare class BillingProfileEntityModel extends BaseEntityModel<EntityEnum.BILLING_PROFILE> implements IBillingProfileEntity {
7
+ id: number;
8
+ name: BillingProfileName;
9
+ logoFilePath: string;
10
+ pan: string;
11
+ code: BillingProfileCode;
12
+ createdOn: number;
13
+ updatedOn: number;
14
+ createdBy: number;
15
+ updatedBy: number;
16
+ constructor();
17
+ static fromEntity(entity: IBillingProfileEntity): BillingProfileEntityModel;
18
+ getRelationConfigs(): any[];
19
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingProfileEntityModel = void 0;
4
+ const entity_utils_interface_1 = require("../interface/entity.utils.interface");
5
+ const base_entity_model_1 = require("./base.entity.model");
6
+ class BillingProfileEntityModel extends base_entity_model_1.BaseEntityModel {
7
+ constructor() {
8
+ super(entity_utils_interface_1.EntityEnum.BILLING_PROFILE);
9
+ this.id = 0;
10
+ this.name = "";
11
+ this.logoFilePath = "";
12
+ this.pan = "";
13
+ this.code = "";
14
+ this.createdOn = 0;
15
+ this.updatedOn = 0;
16
+ this.createdBy = 0;
17
+ this.updatedBy = 0;
18
+ }
19
+ static fromEntity(entity) {
20
+ const model = new BillingProfileEntityModel();
21
+ Object.assign(model, entity);
22
+ return model;
23
+ }
24
+ getRelationConfigs() {
25
+ return this.constructor.prototype.constructor.relationConfigs || [];
26
+ }
27
+ }
28
+ exports.BillingProfileEntityModel = BillingProfileEntityModel;
@@ -15,6 +15,7 @@ import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
15
15
  import { RelationConfigs } from "../interface/relation-config.interface";
16
16
  import { BankEntityModel } from "./bank.entity.model";
17
17
  import { BaseEntityModel } from "./base.entity.model";
18
+ import { BillingProfileEntityModel } from "./billing-profile.entity.model";
18
19
  import { BillingReimbursementExpneseEntityModel } from "./billing-reimbursement-expense.entity.model";
19
20
  import { BillingTimesheetEntityModel } from "./billing-timesheet.entity.model";
20
21
  import { BillingTransactionEntityModel } from "./billing-transaction.model";
@@ -107,6 +108,7 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
107
108
  getTotalRecievableAmount(): number;
108
109
  validateAdvanceBillingId(adjustedBillingTransactions: IBillingTransactionEntity[]): void;
109
110
  getApprovedBillingTransactionsTotalAmount(): number;
111
+ getCurrentBillingBillingProfile(billingProfiles: BillingProfileEntityModel[]): BillingProfileEntityModel[];
110
112
  static getNextInvoiceNumber(params: {
111
113
  type: BillingInvoiceNumberPrefixEnum;
112
114
  invoiceDate: Date;
@@ -280,6 +280,10 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
280
280
  var _a, _b;
281
281
  return (0, utils_1.sumNormalised)((_b = (_a = this.billingTransactions) === null || _a === void 0 ? void 0 : _a.filter((entity) => ![billing_transaction_status_enum_1.BillingTransactionStatusEnum.CREDITNOTE_APPROVAL_PENDING, billing_transaction_status_enum_1.BillingTransactionStatusEnum.WRITEOFF_APPROVAL_PENDING].includes(entity.status))) !== null && _b !== void 0 ? _b : [], "amount");
282
282
  }
283
+ getCurrentBillingBillingProfile(billingProfiles) {
284
+ const billingParticularsOfCurrentBilling = JSON.parse(this.particulars);
285
+ return billingProfiles.filter((profile) => profile.name === billingParticularsOfCurrentBilling.name);
286
+ }
283
287
  static getNextInvoiceNumber(params) {
284
288
  // Draft numbers never use FY-based logic
285
289
  if (params.type === invoice_number_prefix_enum_1.BillingInvoiceNumberPrefixEnum.DRAFT) {
@@ -301,7 +305,7 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
301
305
  var _a, _b, _c, _d;
302
306
  const { prevFY, currFY } = utils_1.DateCodeModel.getFinancialYearCodesFromDate(params.invoiceDate);
303
307
  const month = String(params.invoiceDate.getMonth() + 1).padStart(2, "0");
304
- const basePrefix = `${constants_1.billingPrefixCompanyName}${constants_1.billingSequenceSeperatorForCurrentFy}${prevFY}-${currFY}${constants_1.billingSequenceSeperatorForCurrentFy}${month}${constants_1.billingSequenceSeperator}`;
308
+ const basePrefix = `${constants_1.billingSequenceSeperatorForCurrentFy}${prevFY}-${currFY}${constants_1.billingSequenceSeperatorForCurrentFy}${month}${constants_1.billingSequenceSeperator}`;
305
309
  let lastNumber;
306
310
  switch (params.type) {
307
311
  case invoice_number_prefix_enum_1.BillingInvoiceNumberPrefixEnum.DRAFT:
@@ -14,6 +14,7 @@ const address_book_model_1 = require("./address_book.model");
14
14
  const bank_entity_model_1 = require("./bank.entity.model");
15
15
  const bank_history_entity_model_1 = require("./bank_history.entity.model");
16
16
  const base_entity_model_1 = require("./base.entity.model");
17
+ const billing_profile_entity_model_1 = require("./billing-profile.entity.model");
17
18
  const billing_reimbursement_expense_history_entity_model_1 = require("./billing-reimbursement-expense-history.entity.model");
18
19
  const billing_reimbursement_expense_entity_model_1 = require("./billing-reimbursement-expense.entity.model");
19
20
  const billing_timesheet_entity_model_1 = require("./billing-timesheet.entity.model");
@@ -170,6 +171,7 @@ exports.entityEnumToEntityModel = {
170
171
  [entity_utils_interface_1.EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION]: website_newsletter_subscription_entity_model_1.WebsiteNewsletterSubscriptionEntityModel.fromEntity,
171
172
  [entity_utils_interface_1.EntityEnum.CLIENT_QUOTE]: client_quote_entity_model_1.ClientQuoteEntityModel.fromEntity,
172
173
  [entity_utils_interface_1.EntityEnum.CLIENT_QUOTE_RATE]: client_quote_rate_entity_model_1.ClientQuoteRateEntityModel.fromEntity,
174
+ [entity_utils_interface_1.EntityEnum.BILLING_PROFILE]: billing_profile_entity_model_1.BillingProfileEntityModel.fromEntity,
173
175
  };
174
176
  function entityMapToModels(entityMap) {
175
177
  for (const entityName in entityMap) {
package/package.json CHANGED
@@ -1,41 +1,41 @@
1
- {
2
- "name": "law-common",
3
- "version": "10.66.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
- },
22
- "keywords": [],
23
- "author": "",
24
- "license": "ISC",
25
- "devDependencies": {
26
- "@types/jest": "^29.5.13",
27
- "@types/lodash": "^4.17.21",
28
- "@types/node": "^22.6.1",
29
- "jest": "^29.7.0",
30
- "prettier": "3.8.1",
31
- "ts-jest": "^29.2.5",
32
- "ts-node": "^10.9.2",
33
- "typescript": "^5.6.2"
34
- },
35
- "dependencies": {
36
- "@types/express": "^5.0.0",
37
- "@types/multer": "^1.4.12",
38
- "date-fns": "^4.1.0",
39
- "lodash": "4.17.21"
40
- }
41
- }
1
+ {
2
+ "name": "law-common",
3
+ "version": "10.67.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 && 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
+ },
22
+ "keywords": [],
23
+ "author": "",
24
+ "license": "ISC",
25
+ "devDependencies": {
26
+ "@types/jest": "^29.5.13",
27
+ "@types/lodash": "^4.17.21",
28
+ "@types/node": "^22.6.1",
29
+ "jest": "^29.7.0",
30
+ "prettier": "3.8.1",
31
+ "ts-jest": "^29.2.5",
32
+ "ts-node": "^10.9.2",
33
+ "typescript": "^5.6.2"
34
+ },
35
+ "dependencies": {
36
+ "@types/express": "^5.0.0",
37
+ "@types/multer": "^1.4.12",
38
+ "date-fns": "^4.1.0",
39
+ "lodash": "4.17.21"
40
+ }
41
+ }