law-common 10.63.4-beta.13 → 10.63.4-beta.14
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 +1 -1
- package/dist/src/api/index.d.ts +4 -0
- package/dist/src/api/index.js +4 -0
- package/dist/src/api/interface/client_quote.create.dto.interface.d.ts +7 -0
- package/dist/src/api/interface/client_quote.create.dto.interface.js +2 -0
- package/dist/src/api/interface/client_quote.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/client_quote.update.dto.interface.js +2 -0
- package/dist/src/api/interface/client_quote_rate.create.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/client_quote_rate.create.dto.interface.js +2 -0
- package/dist/src/api/interface/client_quote_rate.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/client_quote_rate.update.dto.interface.js +2 -0
- package/dist/src/entities/enums/client_quote_currency_enum.d.ts +6 -0
- package/dist/src/entities/enums/client_quote_currency_enum.js +10 -0
- package/dist/src/entities/enums/client_quote_rate_type_enum.d.ts +4 -0
- package/dist/src/entities/enums/client_quote_rate_type_enum.js +8 -0
- package/dist/src/entities/enums/client_quote_status_enum.d.ts +5 -0
- package/dist/src/entities/enums/client_quote_status_enum.js +9 -0
- package/dist/src/entities/index.d.ts +7 -0
- package/dist/src/entities/index.js +7 -0
- package/dist/src/entities/interface/client_quote.entity.interface.d.ts +18 -0
- package/dist/src/entities/interface/client_quote.entity.interface.js +2 -0
- package/dist/src/entities/interface/client_quote_rate.entity.interface.d.ts +15 -0
- package/dist/src/entities/interface/client_quote_rate.entity.interface.js +2 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +11 -3
- package/dist/src/entities/interface/entity.utils.interface.js +2 -0
- package/dist/src/entities/model/client_quote.entity.model.d.ts +29 -0
- package/dist/src/entities/model/client_quote.entity.model.js +48 -0
- package/dist/src/entities/model/client_quote_rate.entity.model.d.ts +25 -0
- package/dist/src/entities/model/client_quote_rate.entity.model.js +36 -0
- package/dist/src/entities/model/entity.model.interface.js +9 -1
- package/dist/src/entities/model/rate.model.d.ts +21 -0
- package/dist/src/entities/model/rate.model.js +42 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/number.util.d.ts +7 -0
- package/dist/src/utils/number.util.js +28 -0
- package/package.json +41 -41
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# law-common
|
|
1
|
+
# law-common
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -82,3 +82,7 @@ export * from "./interface/website_lead.create.dto.interface";
|
|
|
82
82
|
export * from "./interface/website_lead.update.dto.interface";
|
|
83
83
|
export * from "./interface/website_newsletter_subscription.create.dto.interface";
|
|
84
84
|
export * from "./interface/website_newsletter_subscription.update.dto.interface";
|
|
85
|
+
export * from "./interface/client_quote.create.dto.interface";
|
|
86
|
+
export * from "./interface/client_quote.update.dto.interface";
|
|
87
|
+
export * from "./interface/client_quote_rate.create.dto.interface";
|
|
88
|
+
export * from "./interface/client_quote_rate.update.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -102,3 +102,7 @@ __exportStar(require("./interface/website_lead.create.dto.interface"), exports);
|
|
|
102
102
|
__exportStar(require("./interface/website_lead.update.dto.interface"), exports);
|
|
103
103
|
__exportStar(require("./interface/website_newsletter_subscription.create.dto.interface"), exports);
|
|
104
104
|
__exportStar(require("./interface/website_newsletter_subscription.update.dto.interface"), exports);
|
|
105
|
+
__exportStar(require("./interface/client_quote.create.dto.interface"), exports);
|
|
106
|
+
__exportStar(require("./interface/client_quote.update.dto.interface"), exports);
|
|
107
|
+
__exportStar(require("./interface/client_quote_rate.create.dto.interface"), exports);
|
|
108
|
+
__exportStar(require("./interface/client_quote_rate.update.dto.interface"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../entities";
|
|
2
|
+
import { IClientQuoteEntity } from "../../entities/interface/client_quote.entity.interface";
|
|
3
|
+
import { IClientQuoteRateCreateDto } from "./client_quote_rate.create.dto.interface";
|
|
4
|
+
export type IClientQuoteCreateExclude = "status";
|
|
5
|
+
export interface IClientQuoteCreateDto extends Omit<IEntityCreateDto<IClientQuoteEntity>, IClientQuoteCreateExclude> {
|
|
6
|
+
clientQuoteRates: IClientQuoteRateCreateDto[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../entities";
|
|
2
|
+
import { IClientQuoteRateEntity } from "../../entities/interface/client_quote_rate.entity.interface";
|
|
3
|
+
export type IClientQuoteRateCreateExclude = never;
|
|
4
|
+
export interface IClientQuoteRateCreateDto extends Omit<IEntityCreateDto<IClientQuoteRateEntity>, IClientQuoteRateCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientQuoteCurrencyEnum = void 0;
|
|
4
|
+
var ClientQuoteCurrencyEnum;
|
|
5
|
+
(function (ClientQuoteCurrencyEnum) {
|
|
6
|
+
ClientQuoteCurrencyEnum["INR"] = "INR";
|
|
7
|
+
ClientQuoteCurrencyEnum["USD"] = "USD";
|
|
8
|
+
ClientQuoteCurrencyEnum["EUR"] = "EUR";
|
|
9
|
+
ClientQuoteCurrencyEnum["GBP"] = "GBP";
|
|
10
|
+
})(ClientQuoteCurrencyEnum || (exports.ClientQuoteCurrencyEnum = ClientQuoteCurrencyEnum = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientQuoteRateTypeEnum = void 0;
|
|
4
|
+
var ClientQuoteRateTypeEnum;
|
|
5
|
+
(function (ClientQuoteRateTypeEnum) {
|
|
6
|
+
ClientQuoteRateTypeEnum["INDIVIDUAL"] = "INDIVIDUAL";
|
|
7
|
+
ClientQuoteRateTypeEnum["BLENDED"] = "BLENDED";
|
|
8
|
+
})(ClientQuoteRateTypeEnum || (exports.ClientQuoteRateTypeEnum = ClientQuoteRateTypeEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientQuoteStatusEnum = void 0;
|
|
4
|
+
var ClientQuoteStatusEnum;
|
|
5
|
+
(function (ClientQuoteStatusEnum) {
|
|
6
|
+
ClientQuoteStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
|
+
ClientQuoteStatusEnum["INACTIVE"] = "INACTIVE";
|
|
8
|
+
ClientQuoteStatusEnum["DEACTIVE"] = "DEACTIVE";
|
|
9
|
+
})(ClientQuoteStatusEnum || (exports.ClientQuoteStatusEnum = ClientQuoteStatusEnum = {}));
|
|
@@ -172,3 +172,10 @@ export * from "./enums/vendor_invoice_item_action.enum";
|
|
|
172
172
|
export * from "./enums/vendor_invoice_item_status.enum";
|
|
173
173
|
export * from "./flow-configs/vendor-invoice-flow.config";
|
|
174
174
|
export * from "./flow-configs/flow-config.type";
|
|
175
|
+
export * from "./enums/client_quote_currency_enum";
|
|
176
|
+
export * from "./enums/client_quote_rate_type_enum";
|
|
177
|
+
export * from "./enums/client_quote_status_enum";
|
|
178
|
+
export * from "./interface/client_quote.entity.interface";
|
|
179
|
+
export * from "./interface/client_quote_rate.entity.interface";
|
|
180
|
+
export * from "./model/client_quote.entity.model";
|
|
181
|
+
export * from "./model/client_quote_rate.entity.model";
|
|
@@ -188,3 +188,10 @@ __exportStar(require("./enums/vendor_invoice_item_action.enum"), exports);
|
|
|
188
188
|
__exportStar(require("./enums/vendor_invoice_item_status.enum"), exports);
|
|
189
189
|
__exportStar(require("./flow-configs/vendor-invoice-flow.config"), exports);
|
|
190
190
|
__exportStar(require("./flow-configs/flow-config.type"), exports);
|
|
191
|
+
__exportStar(require("./enums/client_quote_currency_enum"), exports);
|
|
192
|
+
__exportStar(require("./enums/client_quote_rate_type_enum"), exports);
|
|
193
|
+
__exportStar(require("./enums/client_quote_status_enum"), exports);
|
|
194
|
+
__exportStar(require("./interface/client_quote.entity.interface"), exports);
|
|
195
|
+
__exportStar(require("./interface/client_quote_rate.entity.interface"), exports);
|
|
196
|
+
__exportStar(require("./model/client_quote.entity.model"), exports);
|
|
197
|
+
__exportStar(require("./model/client_quote_rate.entity.model"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { Nullable } from "./entity.utils.interface";
|
|
3
|
+
import { ClientQuoteCurrencyEnum } from "../enums/client_quote_currency_enum";
|
|
4
|
+
import { ClientQuoteStatusEnum } from "../enums/client_quote_status_enum";
|
|
5
|
+
export interface IClientQuoteEntity extends IEntityAuditColumn {
|
|
6
|
+
id: number;
|
|
7
|
+
clientName: string;
|
|
8
|
+
projectName?: Nullable<string>;
|
|
9
|
+
currency: ClientQuoteCurrencyEnum;
|
|
10
|
+
marginPercentage: number;
|
|
11
|
+
status: ClientQuoteStatusEnum;
|
|
12
|
+
costMinTotal: number;
|
|
13
|
+
costMaxTotal: number;
|
|
14
|
+
billingMinTotal: number;
|
|
15
|
+
billingMaxTotal: number;
|
|
16
|
+
idealMinTotal: number;
|
|
17
|
+
idealMaxTotal: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
export interface IClientQuoteRateEntity extends IEntityAuditColumn {
|
|
3
|
+
id: number;
|
|
4
|
+
clientQuoteId: number;
|
|
5
|
+
resourceType: string;
|
|
6
|
+
headCount: number;
|
|
7
|
+
billingHourlyRate: number;
|
|
8
|
+
minHour: number;
|
|
9
|
+
maxHour: number;
|
|
10
|
+
billingMinTotal: number;
|
|
11
|
+
billingMaxTotal: number;
|
|
12
|
+
costHourlyRate: number;
|
|
13
|
+
costMinTotal: number;
|
|
14
|
+
costMaxTotal: number;
|
|
15
|
+
}
|
|
@@ -12,8 +12,11 @@ import { BillingTransactionEntityModel } from "../model/billing-transaction.mode
|
|
|
12
12
|
import { BillingEntityModel } from "../model/billing.entity.model";
|
|
13
13
|
import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
|
|
14
14
|
import { ClientEntityModel } from "../model/client.entity.model";
|
|
15
|
+
import { ClientQuoteEntityModel } from "../model/client_quote.entity.model";
|
|
16
|
+
import { ClientQuoteRateEntityModel } from "../model/client_quote_rate.entity.model";
|
|
15
17
|
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
16
18
|
import { CountryEntityModel } from "../model/country.entity.model";
|
|
19
|
+
import { DesignationEntityModel } from "../model/designation.entity.model";
|
|
17
20
|
import { DocumentUploadEntityModel } from "../model/document_upload.entity.model";
|
|
18
21
|
import { ExpenseHeadEntityModel } from "../model/expense_head.entity.model";
|
|
19
22
|
import { GstRateEntityModel } from "../model/gst_rate.entity.model";
|
|
@@ -27,6 +30,7 @@ import { OrganizationTypeTdsRateMappingEntityModel } from "../model/organization
|
|
|
27
30
|
import { PermissionEntityModel } from "../model/permissions.entity.model";
|
|
28
31
|
import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.entity.model";
|
|
29
32
|
import { ProjectEntityModel } from "../model/project.entity.model";
|
|
33
|
+
import { RateEntityModel } from "../model/rate.model";
|
|
30
34
|
import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
|
|
31
35
|
import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
32
36
|
import { RolePermissionMappingEntityModel } from "../model/role-permission.entity.model";
|
|
@@ -55,6 +59,8 @@ import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
|
55
59
|
import { IBillingTransactionEntity } from "./billing_transaction.entity.interface";
|
|
56
60
|
import { IClientEntity, IClientIntroducingMappingEntity, IClientUserMappingEntity } from "./client.entity.interface";
|
|
57
61
|
import { IClientAffiliateEntity } from "./client_affiliate_entity.interface";
|
|
62
|
+
import { IClientQuoteEntity } from "./client_quote.entity.interface";
|
|
63
|
+
import { IClientQuoteRateEntity } from "./client_quote_rate.entity.interface";
|
|
58
64
|
import { IConfigurationEntity } from "./configuration.entity.interface";
|
|
59
65
|
import { ICountryEntity } from "./country.entity.interface";
|
|
60
66
|
import { ICronJobsEntity } from "./cron-job.entity.interface";
|
|
@@ -200,7 +206,9 @@ export declare enum EntityEnum {
|
|
|
200
206
|
WEBSITE_LEAD = "website_lead",
|
|
201
207
|
WEBSITE_NEWSLETTER_SUBSCRIPTION = "website_newsletter_subscription",
|
|
202
208
|
VENDOR_INVOICE_ITEM_HISTORY = "vendor_invoice_item_history",
|
|
203
|
-
VENDOR_HISTORY = "vendor_history"
|
|
209
|
+
VENDOR_HISTORY = "vendor_history",
|
|
210
|
+
CLIENT_QUOTE = "client_quote",
|
|
211
|
+
CLIENT_QUOTE_RATE = "client_quote_rate"
|
|
204
212
|
}
|
|
205
213
|
export type EntityRelations = {
|
|
206
214
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -219,7 +227,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
219
227
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
220
228
|
};
|
|
221
229
|
};
|
|
222
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.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.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 : never) & {
|
|
230
|
+
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.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.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) & {
|
|
223
231
|
id: number;
|
|
224
232
|
};
|
|
225
233
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -343,7 +351,7 @@ export declare enum VirtualEntityEnum {
|
|
|
343
351
|
}
|
|
344
352
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
345
353
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
346
|
-
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : 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.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.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : 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.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.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : UserEntityModel;
|
|
354
|
+
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : 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.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.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : 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.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.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : UserEntityModel;
|
|
347
355
|
export type EntityMap = {
|
|
348
356
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
349
357
|
};
|
|
@@ -95,6 +95,8 @@ var EntityEnum;
|
|
|
95
95
|
EntityEnum["WEBSITE_NEWSLETTER_SUBSCRIPTION"] = "website_newsletter_subscription";
|
|
96
96
|
EntityEnum["VENDOR_INVOICE_ITEM_HISTORY"] = "vendor_invoice_item_history";
|
|
97
97
|
EntityEnum["VENDOR_HISTORY"] = "vendor_history";
|
|
98
|
+
EntityEnum["CLIENT_QUOTE"] = "client_quote";
|
|
99
|
+
EntityEnum["CLIENT_QUOTE_RATE"] = "client_quote_rate";
|
|
98
100
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
99
101
|
var VirtualEntityEnum;
|
|
100
102
|
(function (VirtualEntityEnum) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
3
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
+
import { IClientQuoteEntity } from "../interface/client_quote.entity.interface";
|
|
5
|
+
import { ClientQuoteCurrencyEnum } from "../enums/client_quote_currency_enum";
|
|
6
|
+
import { ClientQuoteStatusEnum } from "../enums/client_quote_status_enum";
|
|
7
|
+
import { ClientQuoteRateEntityModel } from "./client_quote_rate.entity.model";
|
|
8
|
+
export declare class ClientQuoteEntityModel extends BaseEntityModel<EntityEnum.CLIENT_QUOTE> implements IClientQuoteEntity {
|
|
9
|
+
id: number;
|
|
10
|
+
clientName: string;
|
|
11
|
+
projectName?: string;
|
|
12
|
+
currency: ClientQuoteCurrencyEnum;
|
|
13
|
+
marginPercentage: number;
|
|
14
|
+
costMinTotal: number;
|
|
15
|
+
costMaxTotal: number;
|
|
16
|
+
billingMinTotal: number;
|
|
17
|
+
billingMaxTotal: number;
|
|
18
|
+
idealMinTotal: number;
|
|
19
|
+
idealMaxTotal: number;
|
|
20
|
+
status: ClientQuoteStatusEnum;
|
|
21
|
+
createdOn: number;
|
|
22
|
+
updatedOn: number;
|
|
23
|
+
createdBy: number;
|
|
24
|
+
updatedBy: number;
|
|
25
|
+
clientQuoteRates?: ClientQuoteRateEntityModel[];
|
|
26
|
+
static relationConfigs: RelationConfigs<[EntityEnum.CLIENT_QUOTE_RATE], EntityEnum.CLIENT_QUOTE>;
|
|
27
|
+
static fromEntity(entity: IClientQuoteEntity): ClientQuoteEntityModel;
|
|
28
|
+
getRelationConfigs(): any[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientQuoteEntityModel = void 0;
|
|
4
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
7
|
+
const client_quote_currency_enum_1 = require("../enums/client_quote_currency_enum");
|
|
8
|
+
const client_quote_status_enum_1 = require("../enums/client_quote_status_enum");
|
|
9
|
+
class ClientQuoteEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.id = 0;
|
|
13
|
+
this.clientName = "";
|
|
14
|
+
this.currency = client_quote_currency_enum_1.ClientQuoteCurrencyEnum.INR;
|
|
15
|
+
this.marginPercentage = 0;
|
|
16
|
+
this.costMinTotal = 0;
|
|
17
|
+
this.costMaxTotal = 0;
|
|
18
|
+
this.billingMinTotal = 0;
|
|
19
|
+
this.billingMaxTotal = 0;
|
|
20
|
+
this.idealMinTotal = 0;
|
|
21
|
+
this.idealMaxTotal = 0;
|
|
22
|
+
this.status = client_quote_status_enum_1.ClientQuoteStatusEnum.ACTIVE;
|
|
23
|
+
this.createdOn = 0;
|
|
24
|
+
this.updatedOn = 0;
|
|
25
|
+
this.createdBy = 0;
|
|
26
|
+
this.updatedBy = 0;
|
|
27
|
+
}
|
|
28
|
+
static fromEntity(entity) {
|
|
29
|
+
const result = new ClientQuoteEntityModel(entity_utils_interface_1.EntityEnum.CLIENT_QUOTE);
|
|
30
|
+
Object.assign(result, entity);
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
getRelationConfigs() {
|
|
34
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.ClientQuoteEntityModel = ClientQuoteEntityModel;
|
|
38
|
+
ClientQuoteEntityModel.relationConfigs = [
|
|
39
|
+
{
|
|
40
|
+
name: entity_utils_interface_1.EntityEnum.CLIENT_QUOTE_RATE,
|
|
41
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
42
|
+
key: "clientQuoteRates",
|
|
43
|
+
mapKeyConfig: {
|
|
44
|
+
relationKey: "clientQuoteId",
|
|
45
|
+
key: "id",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
3
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
+
import { IClientQuoteRateEntity } from "../interface/client_quote_rate.entity.interface";
|
|
5
|
+
export declare class ClientQuoteRateEntityModel extends BaseEntityModel<EntityEnum.CLIENT_QUOTE_RATE> implements IClientQuoteRateEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
clientQuoteId: number;
|
|
8
|
+
resourceType: string;
|
|
9
|
+
headCount: number;
|
|
10
|
+
billingHourlyRate: number;
|
|
11
|
+
minHour: number;
|
|
12
|
+
maxHour: number;
|
|
13
|
+
billingMinTotal: number;
|
|
14
|
+
billingMaxTotal: number;
|
|
15
|
+
costHourlyRate: number;
|
|
16
|
+
costMinTotal: number;
|
|
17
|
+
costMaxTotal: number;
|
|
18
|
+
createdOn: number;
|
|
19
|
+
updatedOn: number;
|
|
20
|
+
createdBy: number;
|
|
21
|
+
updatedBy: number;
|
|
22
|
+
static relationConfigs: RelationConfigs<[], EntityEnum.CLIENT_QUOTE_RATE>;
|
|
23
|
+
static fromEntity(entity: IClientQuoteRateEntity): ClientQuoteRateEntityModel;
|
|
24
|
+
getRelationConfigs(): any[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientQuoteRateEntityModel = 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 ClientQuoteRateEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.id = 0;
|
|
10
|
+
this.clientQuoteId = 0;
|
|
11
|
+
this.resourceType = "";
|
|
12
|
+
this.headCount = 0;
|
|
13
|
+
this.billingHourlyRate = 0;
|
|
14
|
+
this.minHour = 0;
|
|
15
|
+
this.maxHour = 0;
|
|
16
|
+
this.billingMinTotal = 0;
|
|
17
|
+
this.billingMaxTotal = 0;
|
|
18
|
+
this.costHourlyRate = 0;
|
|
19
|
+
this.costMinTotal = 0;
|
|
20
|
+
this.costMaxTotal = 0;
|
|
21
|
+
this.createdOn = 0;
|
|
22
|
+
this.updatedOn = 0;
|
|
23
|
+
this.createdBy = 0;
|
|
24
|
+
this.updatedBy = 0;
|
|
25
|
+
}
|
|
26
|
+
static fromEntity(entity) {
|
|
27
|
+
const result = new ClientQuoteRateEntityModel(entity_utils_interface_1.EntityEnum.CLIENT_QUOTE_RATE);
|
|
28
|
+
Object.assign(result, entity);
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
getRelationConfigs() {
|
|
32
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ClientQuoteRateEntityModel = ClientQuoteRateEntityModel;
|
|
36
|
+
ClientQuoteRateEntityModel.relationConfigs = [];
|
|
@@ -19,8 +19,11 @@ const billing_transaction_model_1 = require("./billing-transaction.model");
|
|
|
19
19
|
const billing_entity_model_1 = require("./billing.entity.model");
|
|
20
20
|
const client_affiliate_entity_model_1 = require("./client-affiliate.entity.model");
|
|
21
21
|
const client_entity_model_1 = require("./client.entity.model");
|
|
22
|
+
const client_quote_entity_model_1 = require("./client_quote.entity.model");
|
|
23
|
+
const client_quote_rate_entity_model_1 = require("./client_quote_rate.entity.model");
|
|
22
24
|
const configuration_model_1 = require("./configuration.model");
|
|
23
25
|
const country_entity_model_1 = require("./country.entity.model");
|
|
26
|
+
const designation_entity_model_1 = require("./designation.entity.model");
|
|
24
27
|
const document_upload_entity_model_1 = require("./document_upload.entity.model");
|
|
25
28
|
const expense_head_entity_model_1 = require("./expense_head.entity.model");
|
|
26
29
|
const gst_rate_entity_model_1 = require("./gst_rate.entity.model");
|
|
@@ -34,6 +37,7 @@ const organization_type_tds_rate_mapping_entity_model_1 = require("./organizatio
|
|
|
34
37
|
const permissions_entity_model_1 = require("./permissions.entity.model");
|
|
35
38
|
const project_user_mapping_entity_model_1 = require("./project-user-mapping.entity.model");
|
|
36
39
|
const project_entity_model_1 = require("./project.entity.model");
|
|
40
|
+
const rate_model_1 = require("./rate.model");
|
|
37
41
|
const reimbursement_expense_entity_model_1 = require("./reimbursement-expense.entity.model");
|
|
38
42
|
const reimbursement_entity_model_1 = require("./reimbursement.entity.model");
|
|
39
43
|
const role_permission_entity_model_1 = require("./role-permission.entity.model");
|
|
@@ -120,11 +124,15 @@ exports.entityEnumToEntityModel = {
|
|
|
120
124
|
[entity_utils_interface_1.EntityEnum.OFFICE_LOCATION]: office_location_entity_model_1.OfficeLocationEntityModel.fromEntity,
|
|
121
125
|
[entity_utils_interface_1.EntityEnum.WEBSITE_LEAD]: website_lead_entity_model_1.WebsiteLeadEntityModel.fromEntity,
|
|
122
126
|
[entity_utils_interface_1.EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION]: website_newsletter_subscription_entity_model_1.WebsiteNewsletterSubscriptionEntityModel.fromEntity,
|
|
127
|
+
[entity_utils_interface_1.EntityEnum.CLIENT_QUOTE]: client_quote_entity_model_1.ClientQuoteEntityModel.fromEntity,
|
|
128
|
+
[entity_utils_interface_1.EntityEnum.CLIENT_QUOTE_RATE]: client_quote_rate_entity_model_1.ClientQuoteRateEntityModel.fromEntity,
|
|
129
|
+
[entity_utils_interface_1.EntityEnum.DESIGNATION]: designation_entity_model_1.DesignationEntityModel.fromEntity,
|
|
130
|
+
[entity_utils_interface_1.EntityEnum.RATE]: rate_model_1.RateEntityModel.fromEntity,
|
|
123
131
|
};
|
|
124
132
|
function entityMapToModels(entityMap) {
|
|
125
133
|
for (const entityName in entityMap) {
|
|
126
134
|
if (!(entityName in exports.entityEnumToEntityModel)) {
|
|
127
|
-
throw new Error(`
|
|
135
|
+
throw new Error(`Mapping not found for entity: ${entityName} found in entityMapToModels function of law-common entity.model.interface.ts`);
|
|
128
136
|
}
|
|
129
137
|
entityMap[entityName] = entityMap[entityName].map((entity) => exports.entityEnumToEntityModel[entityName](
|
|
130
138
|
// @ts-ignore
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TimeUnitEnum, CurrencyEnum } from "../../enums";
|
|
2
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
3
|
+
import { IRateEntity } from "../interface/rate.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
import { DesignationEntityModel } from "./designation.entity.model";
|
|
6
|
+
export declare class RateEntityModel extends BaseEntityModel<EntityEnum.RATE> implements IRateEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
designation: string;
|
|
9
|
+
rate: number;
|
|
10
|
+
unit: TimeUnitEnum;
|
|
11
|
+
currency: CurrencyEnum;
|
|
12
|
+
createdOn: number;
|
|
13
|
+
updatedOn: number;
|
|
14
|
+
createdBy: number;
|
|
15
|
+
updatedBy: number;
|
|
16
|
+
static fromEntity(entity: IRateEntity): RateEntityModel;
|
|
17
|
+
getRelationConfigs(): any[];
|
|
18
|
+
static getByDesignation(designation: string, roleModels: RateEntityModel[], designationModels: DesignationEntityModel[]): RateEntityModel[];
|
|
19
|
+
static getByCurrency(currency: string, roleModels: RateEntityModel[]): RateEntityModel | undefined;
|
|
20
|
+
static getByDesignationCurrency(designation: string, currency: string, roleModels: RateEntityModel[], designationModels: DesignationEntityModel[]): RateEntityModel | undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RateEntityModel = 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 RateEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
|
+
static fromEntity(entity) {
|
|
8
|
+
const result = new RateEntityModel(entity_utils_interface_1.EntityEnum.RATE);
|
|
9
|
+
Object.assign(result, entity);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
getRelationConfigs() {
|
|
13
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
14
|
+
}
|
|
15
|
+
static getByDesignation(designation, roleModels, designationModels) {
|
|
16
|
+
const filteredDesignationModels = designationModels.filter((designationModel) => designationModel.name === designation);
|
|
17
|
+
if (filteredDesignationModels.length === 0) {
|
|
18
|
+
console.warn(`No rate model found for designation: ${designation}. Returning empty array.`);
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
return roleModels.filter((role) => filteredDesignationModels.some((designationModel) => designationModel.name === role.designation));
|
|
22
|
+
}
|
|
23
|
+
static getByCurrency(currency, roleModels) {
|
|
24
|
+
const filteredCurrencyModels = roleModels.filter((role) => role.currency === currency);
|
|
25
|
+
if (filteredCurrencyModels.length === 0) {
|
|
26
|
+
console.warn(`No rate model found for currency: ${currency}. Returning undefined.`);
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
if (filteredCurrencyModels.length > 1) {
|
|
30
|
+
console.warn(`Multiple rate models found for currency: ${currency}. Returning the first matching model.`);
|
|
31
|
+
}
|
|
32
|
+
return filteredCurrencyModels[0];
|
|
33
|
+
}
|
|
34
|
+
static getByDesignationCurrency(designation, currency, roleModels, designationModels) {
|
|
35
|
+
const filteredDesignationModels = RateEntityModel.getByDesignation(designation, roleModels, designationModels);
|
|
36
|
+
if (filteredDesignationModels.length === 0) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return RateEntityModel.getByCurrency(currency, filteredDesignationModels);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.RateEntityModel = RateEntityModel;
|
package/dist/src/utils/index.js
CHANGED
|
@@ -22,3 +22,4 @@ __exportStar(require("./entity.flow.util"), exports);
|
|
|
22
22
|
__exportStar(require("./helper.fn.util"), exports);
|
|
23
23
|
__exportStar(require("./models/date-code.model.util"), exports);
|
|
24
24
|
__exportStar(require("./string.util"), exports);
|
|
25
|
+
__exportStar(require("./number.util"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function roundToDecimalPlaces(num: number, decimalPlaces?: number): number;
|
|
2
|
+
export declare function roundToNearestInteger(num: number): number;
|
|
3
|
+
export declare function currencyFormatter(value: number | string | null | undefined, currency?: string, config?: {
|
|
4
|
+
showSymbol?: boolean;
|
|
5
|
+
minimumFractionDigits?: number;
|
|
6
|
+
maximumFractionDigits?: number;
|
|
7
|
+
}): string;
|
|
@@ -1 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.roundToDecimalPlaces = roundToDecimalPlaces;
|
|
4
|
+
exports.roundToNearestInteger = roundToNearestInteger;
|
|
5
|
+
exports.currencyFormatter = currencyFormatter;
|
|
6
|
+
function roundToDecimalPlaces(num, decimalPlaces = 2) {
|
|
7
|
+
const factor = Math.pow(10, decimalPlaces);
|
|
8
|
+
return Math.round(num * factor) / factor;
|
|
9
|
+
}
|
|
10
|
+
function roundToNearestInteger(num) {
|
|
11
|
+
return Math.round(num);
|
|
12
|
+
}
|
|
13
|
+
function currencyFormatter(value, currency = "INR", config = {}) {
|
|
14
|
+
const { showSymbol = true, minimumFractionDigits = 2, maximumFractionDigits = 2 } = config;
|
|
15
|
+
if (value === null || value === undefined || value === "") {
|
|
16
|
+
return "—";
|
|
17
|
+
}
|
|
18
|
+
const numericValue = typeof value === "string" ? parseFloat(value) : value;
|
|
19
|
+
if (isNaN(numericValue)) {
|
|
20
|
+
return "—";
|
|
21
|
+
}
|
|
22
|
+
const formatted = new Intl.NumberFormat("en-IN", {
|
|
23
|
+
style: "currency",
|
|
24
|
+
currency: currency || "INR",
|
|
25
|
+
minimumFractionDigits: minimumFractionDigits,
|
|
26
|
+
maximumFractionDigits: maximumFractionDigits,
|
|
27
|
+
}).format(numericValue);
|
|
28
|
+
return showSymbol ? formatted : formatted.replace(/[^\d.,\s]/g, "").trim();
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.63.4-beta.
|
|
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.63.4-beta.14",
|
|
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
|
+
}
|