law-common 10.63.4-beta.7 → 10.63.4-beta.9
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 +0 -4
- package/dist/src/api/index.js +0 -4
- package/dist/src/api/interface/vendor.create.dto.interface.d.ts +2 -0
- package/dist/src/entities/enums/vendor_invoice_action_status_enum.d.ts +0 -1
- package/dist/src/entities/enums/vendor_invoice_action_status_enum.js +1 -6
- package/dist/src/entities/flow-configs/vendor-invoice-flow.config.js +16 -14
- package/dist/src/entities/index.d.ts +0 -7
- package/dist/src/entities/index.js +0 -7
- package/dist/src/entities/interface/entity.utils.interface.d.ts +3 -11
- package/dist/src/entities/interface/entity.utils.interface.js +0 -2
- package/dist/src/entities/model/entity.model.interface.d.ts +4 -0
- package/dist/src/entities/model/entity.model.interface.js +5 -9
- package/package.json +41 -41
- package/dist/src/api/interface/client_quote.create.dto.interface.d.ts +0 -7
- package/dist/src/api/interface/client_quote.create.dto.interface.js +0 -2
- package/dist/src/api/interface/client_quote.update.dto.interface.d.ts +0 -3
- package/dist/src/api/interface/client_quote.update.dto.interface.js +0 -2
- package/dist/src/api/interface/client_quote_rate.create.dto.interface.d.ts +0 -5
- package/dist/src/api/interface/client_quote_rate.create.dto.interface.js +0 -2
- package/dist/src/api/interface/client_quote_rate.update.dto.interface.d.ts +0 -3
- package/dist/src/api/interface/client_quote_rate.update.dto.interface.js +0 -2
- package/dist/src/entities/enums/client_quote_currency_enum.d.ts +0 -6
- package/dist/src/entities/enums/client_quote_currency_enum.js +0 -10
- package/dist/src/entities/enums/client_quote_rate_type_enum.d.ts +0 -4
- package/dist/src/entities/enums/client_quote_rate_type_enum.js +0 -8
- package/dist/src/entities/enums/client_quote_status_enum.d.ts +0 -5
- package/dist/src/entities/enums/client_quote_status_enum.js +0 -9
- package/dist/src/entities/interface/client_quote.entity.interface.d.ts +0 -17
- package/dist/src/entities/interface/client_quote.entity.interface.js +0 -2
- package/dist/src/entities/interface/client_quote_rate.entity.interface.d.ts +0 -12
- package/dist/src/entities/interface/client_quote_rate.entity.interface.js +0 -2
- package/dist/src/entities/model/client_quote.entity.model.d.ts +0 -28
- package/dist/src/entities/model/client_quote.entity.model.js +0 -47
- package/dist/src/entities/model/client_quote_rate.entity.model.d.ts +0 -22
- package/dist/src/entities/model/client_quote_rate.entity.model.js +0 -33
- package/dist/src/entities/model/rate.model.d.ts +0 -20
- package/dist/src/entities/model/rate.model.js +0 -34
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# law-common
|
|
1
|
+
# law-common
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -82,7 +82,3 @@ 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,7 +102,3 @@ __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);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IEntityCreateDto, Nullable } from "../../entities";
|
|
2
2
|
import { IAppFileConfig, IFilePayload, MulterFileWithUrl } from "../../misc";
|
|
3
3
|
import { IVendorEntity } from "../../entities/interface/vendor.entity.interface";
|
|
4
|
+
import { IVendorActionDataDto } from "./vendor.update.dto.interface";
|
|
4
5
|
export interface IVendorContactDetail {
|
|
5
6
|
id: number;
|
|
6
7
|
name?: Nullable<string>;
|
|
@@ -32,6 +33,7 @@ export interface IVendorCreateDto extends Omit<IEntityCreateDto<IVendorEntity>,
|
|
|
32
33
|
contractDocument?: Nullable<MulterFileWithUrl>;
|
|
33
34
|
attachmentDocuments?: Nullable<MulterFileWithUrl[]>;
|
|
34
35
|
files: IFilePayload[];
|
|
36
|
+
actionData?: IVendorActionDataDto;
|
|
35
37
|
}
|
|
36
38
|
export type VendorDocumentFieldNames = ["panDocument", "gstDocument", "contractDocument", "attachmentDocuments"];
|
|
37
39
|
export declare const vendorFileConfig: IAppFileConfig<VendorDocumentFieldNames[number]>[];
|
|
@@ -9,13 +9,8 @@ var VendorInvoiceActionStatusEnum;
|
|
|
9
9
|
VendorInvoiceActionStatusEnum["REJECTED"] = "rejected";
|
|
10
10
|
VendorInvoiceActionStatusEnum["APPROVED"] = "approved";
|
|
11
11
|
VendorInvoiceActionStatusEnum["DELETED"] = "deleted";
|
|
12
|
-
|
|
12
|
+
// RESOLVED_REJECTED = "resolved_rejected",
|
|
13
13
|
VendorInvoiceActionStatusEnum["PAYMENT_DISBURSE"] = "payment_disburse";
|
|
14
|
-
// PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
15
|
-
// APPROVED = "APPROVED",
|
|
16
|
-
// REJECTED = "REJECTED",
|
|
17
|
-
// PARTIALLY_APPROVED = "PARTIALLY_APPROVED",
|
|
18
|
-
// DELETED = "DELETED",
|
|
19
14
|
})(VendorInvoiceActionStatusEnum || (exports.VendorInvoiceActionStatusEnum = VendorInvoiceActionStatusEnum = {}));
|
|
20
15
|
// export enum VendorInvoiceActionStatusEnum {
|
|
21
16
|
// PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
@@ -36,7 +36,8 @@ exports.vendorInvoiceFlowConfig = {
|
|
|
36
36
|
},
|
|
37
37
|
[vendor_invoice_action_enum_1.VendorInvoiceActionEnum.REJECT]: {
|
|
38
38
|
permissions: ["VENDOR_INVOICE_APPROVE"],
|
|
39
|
-
next: () =>
|
|
39
|
+
// next: () => VendorInvoiceActionStatusEnum.RESOLVED_REJECTED,
|
|
40
|
+
next: () => vendor_invoice_action_status_enum_1.VendorInvoiceActionStatusEnum.REJECTED,
|
|
40
41
|
},
|
|
41
42
|
// [VendorInvoiceActionEnum.RECALL]: {
|
|
42
43
|
// permissions: ["VENDOR_INVOICE_UPDATE"],
|
|
@@ -52,7 +53,8 @@ exports.vendorInvoiceFlowConfig = {
|
|
|
52
53
|
},
|
|
53
54
|
[vendor_invoice_action_enum_1.VendorInvoiceActionEnum.REJECT]: {
|
|
54
55
|
permissions: ["VENDOR_INVOICE_APPROVE"],
|
|
55
|
-
next: () =>
|
|
56
|
+
// next: () => VendorInvoiceActionStatusEnum.RESOLVED_REJECTED,
|
|
57
|
+
next: () => vendor_invoice_action_status_enum_1.VendorInvoiceActionStatusEnum.REJECTED,
|
|
56
58
|
},
|
|
57
59
|
// [VendorInvoiceActionEnum.RECALL]: {
|
|
58
60
|
// permissions: ["VENDOR_INVOICE_UPDATE"],
|
|
@@ -76,18 +78,18 @@ exports.vendorInvoiceFlowConfig = {
|
|
|
76
78
|
},
|
|
77
79
|
},
|
|
78
80
|
},
|
|
79
|
-
[
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
81
|
+
// [VendorInvoiceActionStatusEnum.RESOLVED_REJECTED]: {
|
|
82
|
+
// actions: {
|
|
83
|
+
// [VendorInvoiceActionEnum.EDIT]: {
|
|
84
|
+
// permissions: ["VENDOR_INVOICE_UPDATE"],
|
|
85
|
+
// next: () => VendorInvoiceActionStatusEnum.EDIT_APPROVAL,
|
|
86
|
+
// },
|
|
87
|
+
// [VendorInvoiceActionEnum.DELETE]: {
|
|
88
|
+
// permissions: ["VENDOR_INVOICE_UPDATE"],
|
|
89
|
+
// next: () => VendorInvoiceActionStatusEnum.DELETE_APPROVAL,
|
|
90
|
+
// },
|
|
91
|
+
// },
|
|
92
|
+
// },
|
|
91
93
|
};
|
|
92
94
|
// import { IVendorInvoiceFlowContextData } from "../../api";
|
|
93
95
|
// import { VendorInvoiceActionEnum } from "../enums/vendor_invoice_action.enum";
|
|
@@ -172,10 +172,3 @@ 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,10 +188,3 @@ __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);
|
|
@@ -12,11 +12,8 @@ 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";
|
|
17
15
|
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
18
16
|
import { CountryEntityModel } from "../model/country.entity.model";
|
|
19
|
-
import { DesignationEntityModel } from "../model/designation.entity.model";
|
|
20
17
|
import { DocumentUploadEntityModel } from "../model/document_upload.entity.model";
|
|
21
18
|
import { ExpenseHeadEntityModel } from "../model/expense_head.entity.model";
|
|
22
19
|
import { GstRateEntityModel } from "../model/gst_rate.entity.model";
|
|
@@ -30,7 +27,6 @@ import { OrganizationTypeTdsRateMappingEntityModel } from "../model/organization
|
|
|
30
27
|
import { PermissionEntityModel } from "../model/permissions.entity.model";
|
|
31
28
|
import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.entity.model";
|
|
32
29
|
import { ProjectEntityModel } from "../model/project.entity.model";
|
|
33
|
-
import { RateEntityModel } from "../model/rate.model";
|
|
34
30
|
import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
|
|
35
31
|
import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
36
32
|
import { RolePermissionMappingEntityModel } from "../model/role-permission.entity.model";
|
|
@@ -59,8 +55,6 @@ import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
|
59
55
|
import { IBillingTransactionEntity } from "./billing_transaction.entity.interface";
|
|
60
56
|
import { IClientEntity, IClientIntroducingMappingEntity, IClientUserMappingEntity } from "./client.entity.interface";
|
|
61
57
|
import { IClientAffiliateEntity } from "./client_affiliate_entity.interface";
|
|
62
|
-
import { IClientQuoteEntity } from "./client_quote.entity.interface";
|
|
63
|
-
import { IClientQuoteRateEntity } from "./client_quote_rate.entity.interface";
|
|
64
58
|
import { IConfigurationEntity } from "./configuration.entity.interface";
|
|
65
59
|
import { ICountryEntity } from "./country.entity.interface";
|
|
66
60
|
import { ICronJobsEntity } from "./cron-job.entity.interface";
|
|
@@ -206,9 +200,7 @@ export declare enum EntityEnum {
|
|
|
206
200
|
WEBSITE_LEAD = "website_lead",
|
|
207
201
|
WEBSITE_NEWSLETTER_SUBSCRIPTION = "website_newsletter_subscription",
|
|
208
202
|
VENDOR_INVOICE_ITEM_HISTORY = "vendor_invoice_item_history",
|
|
209
|
-
VENDOR_HISTORY = "vendor_history"
|
|
210
|
-
CLIENT_QUOTE = "client_quote",
|
|
211
|
-
CLIENT_QUOTE_RATE = "client_quote_rate"
|
|
203
|
+
VENDOR_HISTORY = "vendor_history"
|
|
212
204
|
}
|
|
213
205
|
export type EntityRelations = {
|
|
214
206
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -227,7 +219,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
227
219
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
228
220
|
};
|
|
229
221
|
};
|
|
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 :
|
|
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) & {
|
|
231
223
|
id: number;
|
|
232
224
|
};
|
|
233
225
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -351,7 +343,7 @@ export declare enum VirtualEntityEnum {
|
|
|
351
343
|
}
|
|
352
344
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
353
345
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
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 :
|
|
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;
|
|
355
347
|
export type EntityMap = {
|
|
356
348
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
357
349
|
};
|
|
@@ -95,8 +95,6 @@ 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";
|
|
100
98
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
101
99
|
var VirtualEntityEnum;
|
|
102
100
|
(function (VirtualEntityEnum) {
|
|
@@ -47,4 +47,8 @@ export declare class EntityModelRelationHelper {
|
|
|
47
47
|
}): EntityModelRelationHelper;
|
|
48
48
|
deleteById(entityEnum: EntityEnum, id: number): EntityModelRelationHelper;
|
|
49
49
|
getEntityModels<T extends EntityEnum | VirtualEntityEnum>(entityEnum: T): EnumToModel<T>[];
|
|
50
|
+
getEntityModelsByFilter<T extends EntityEnum | VirtualEntityEnum>(entityEnum: T, filter: {
|
|
51
|
+
key: keyof EnumToModel<T>;
|
|
52
|
+
value: any;
|
|
53
|
+
}): EnumToModel<T>[];
|
|
50
54
|
}
|
|
@@ -19,11 +19,8 @@ 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");
|
|
24
22
|
const configuration_model_1 = require("./configuration.model");
|
|
25
23
|
const country_entity_model_1 = require("./country.entity.model");
|
|
26
|
-
const designation_entity_model_1 = require("./designation.entity.model");
|
|
27
24
|
const document_upload_entity_model_1 = require("./document_upload.entity.model");
|
|
28
25
|
const expense_head_entity_model_1 = require("./expense_head.entity.model");
|
|
29
26
|
const gst_rate_entity_model_1 = require("./gst_rate.entity.model");
|
|
@@ -37,7 +34,6 @@ const organization_type_tds_rate_mapping_entity_model_1 = require("./organizatio
|
|
|
37
34
|
const permissions_entity_model_1 = require("./permissions.entity.model");
|
|
38
35
|
const project_user_mapping_entity_model_1 = require("./project-user-mapping.entity.model");
|
|
39
36
|
const project_entity_model_1 = require("./project.entity.model");
|
|
40
|
-
const rate_model_1 = require("./rate.model");
|
|
41
37
|
const reimbursement_expense_entity_model_1 = require("./reimbursement-expense.entity.model");
|
|
42
38
|
const reimbursement_entity_model_1 = require("./reimbursement.entity.model");
|
|
43
39
|
const role_permission_entity_model_1 = require("./role-permission.entity.model");
|
|
@@ -124,15 +120,11 @@ exports.entityEnumToEntityModel = {
|
|
|
124
120
|
[entity_utils_interface_1.EntityEnum.OFFICE_LOCATION]: office_location_entity_model_1.OfficeLocationEntityModel.fromEntity,
|
|
125
121
|
[entity_utils_interface_1.EntityEnum.WEBSITE_LEAD]: website_lead_entity_model_1.WebsiteLeadEntityModel.fromEntity,
|
|
126
122
|
[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,
|
|
131
123
|
};
|
|
132
124
|
function entityMapToModels(entityMap) {
|
|
133
125
|
for (const entityName in entityMap) {
|
|
134
126
|
if (!(entityName in exports.entityEnumToEntityModel)) {
|
|
135
|
-
throw new Error(`
|
|
127
|
+
throw new Error(`Unknown entity: ${entityName}`);
|
|
136
128
|
}
|
|
137
129
|
entityMap[entityName] = entityMap[entityName].map((entity) => exports.entityEnumToEntityModel[entityName](
|
|
138
130
|
// @ts-ignore
|
|
@@ -328,5 +320,9 @@ class EntityModelRelationHelper {
|
|
|
328
320
|
getEntityModels(entityEnum) {
|
|
329
321
|
return Object.values(this.entityModelIndexMap[entityEnum] || {});
|
|
330
322
|
}
|
|
323
|
+
getEntityModelsByFilter(entityEnum, filter) {
|
|
324
|
+
const entityModels = Object.values(this.entityModelIndexMap[entityEnum] || {});
|
|
325
|
+
return entityModels.filter((model) => model[filter.key] === filter.value).map((model) => model);
|
|
326
|
+
}
|
|
331
327
|
}
|
|
332
328
|
exports.EntityModelRelationHelper = EntityModelRelationHelper;
|
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.9",
|
|
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,7 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,17 +0,0 @@
|
|
|
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 { ClientQuoteRateTypeEnum } from "../enums/client_quote_rate_type_enum";
|
|
5
|
-
import { ClientQuoteStatusEnum } from "../enums/client_quote_status_enum";
|
|
6
|
-
export interface IClientQuoteEntity extends IEntityAuditColumn {
|
|
7
|
-
id: number;
|
|
8
|
-
clientName: string;
|
|
9
|
-
projectName?: Nullable<string>;
|
|
10
|
-
currency: ClientQuoteCurrencyEnum;
|
|
11
|
-
rateType: ClientQuoteRateTypeEnum;
|
|
12
|
-
marginPercentage: number;
|
|
13
|
-
contingencyBufferPercentage: number;
|
|
14
|
-
floorQuote: number;
|
|
15
|
-
ceilingQuote: number;
|
|
16
|
-
status: ClientQuoteStatusEnum;
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
hourlyRate: number;
|
|
8
|
-
minHour: number;
|
|
9
|
-
maxHour: number;
|
|
10
|
-
minTotal: number;
|
|
11
|
-
maxTotal: number;
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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 { ClientQuoteRateTypeEnum } from "../enums/client_quote_rate_type_enum";
|
|
7
|
-
import { ClientQuoteStatusEnum } from "../enums/client_quote_status_enum";
|
|
8
|
-
import { ClientQuoteRateEntityModel } from "./client_quote_rate.entity.model";
|
|
9
|
-
export declare class ClientQuoteEntityModel extends BaseEntityModel<EntityEnum.CLIENT_QUOTE> implements IClientQuoteEntity {
|
|
10
|
-
id: number;
|
|
11
|
-
clientName: string;
|
|
12
|
-
projectName?: string;
|
|
13
|
-
currency: ClientQuoteCurrencyEnum;
|
|
14
|
-
rateType: ClientQuoteRateTypeEnum;
|
|
15
|
-
marginPercentage: number;
|
|
16
|
-
contingencyBufferPercentage: number;
|
|
17
|
-
floorQuote: number;
|
|
18
|
-
ceilingQuote: number;
|
|
19
|
-
status: ClientQuoteStatusEnum;
|
|
20
|
-
createdOn: number;
|
|
21
|
-
updatedOn: number;
|
|
22
|
-
createdBy: number;
|
|
23
|
-
updatedBy: number;
|
|
24
|
-
clientQuoteRates?: ClientQuoteRateEntityModel[];
|
|
25
|
-
static relationConfigs: RelationConfigs<[EntityEnum.CLIENT_QUOTE_RATE], EntityEnum.CLIENT_QUOTE>;
|
|
26
|
-
static fromEntity(entity: IClientQuoteEntity): ClientQuoteEntityModel;
|
|
27
|
-
getRelationConfigs(): any[];
|
|
28
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
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_rate_type_enum_1 = require("../enums/client_quote_rate_type_enum");
|
|
9
|
-
const client_quote_status_enum_1 = require("../enums/client_quote_status_enum");
|
|
10
|
-
class ClientQuoteEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.id = 0;
|
|
14
|
-
this.clientName = "";
|
|
15
|
-
this.currency = client_quote_currency_enum_1.ClientQuoteCurrencyEnum.INR;
|
|
16
|
-
this.rateType = client_quote_rate_type_enum_1.ClientQuoteRateTypeEnum.INDIVIDUAL;
|
|
17
|
-
this.marginPercentage = 0;
|
|
18
|
-
this.contingencyBufferPercentage = 0;
|
|
19
|
-
this.floorQuote = 0;
|
|
20
|
-
this.ceilingQuote = 0;
|
|
21
|
-
this.status = client_quote_status_enum_1.ClientQuoteStatusEnum.ACTIVE;
|
|
22
|
-
this.createdOn = 0;
|
|
23
|
-
this.updatedOn = 0;
|
|
24
|
-
this.createdBy = 0;
|
|
25
|
-
this.updatedBy = 0;
|
|
26
|
-
}
|
|
27
|
-
static fromEntity(entity) {
|
|
28
|
-
const result = new ClientQuoteEntityModel(entity_utils_interface_1.EntityEnum.CLIENT_QUOTE);
|
|
29
|
-
Object.assign(result, entity);
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
getRelationConfigs() {
|
|
33
|
-
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.ClientQuoteEntityModel = ClientQuoteEntityModel;
|
|
37
|
-
ClientQuoteEntityModel.relationConfigs = [
|
|
38
|
-
{
|
|
39
|
-
name: entity_utils_interface_1.EntityEnum.CLIENT_QUOTE_RATE,
|
|
40
|
-
relation: relation_type_enum_1.RelationType.MANY,
|
|
41
|
-
key: "clientQuoteRates",
|
|
42
|
-
mapKeyConfig: {
|
|
43
|
-
relationKey: "clientQuoteId",
|
|
44
|
-
key: "id",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
];
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
hourlyRate: number;
|
|
11
|
-
minHour: number;
|
|
12
|
-
maxHour: number;
|
|
13
|
-
minTotal: number;
|
|
14
|
-
maxTotal: number;
|
|
15
|
-
createdOn: number;
|
|
16
|
-
updatedOn: number;
|
|
17
|
-
createdBy: number;
|
|
18
|
-
updatedBy: number;
|
|
19
|
-
static relationConfigs: RelationConfigs<[], EntityEnum.CLIENT_QUOTE_RATE>;
|
|
20
|
-
static fromEntity(entity: IClientQuoteRateEntity): ClientQuoteRateEntityModel;
|
|
21
|
-
getRelationConfigs(): any[];
|
|
22
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
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.hourlyRate = 0;
|
|
14
|
-
this.minHour = 0;
|
|
15
|
-
this.maxHour = 0;
|
|
16
|
-
this.minTotal = 0;
|
|
17
|
-
this.maxTotal = 0;
|
|
18
|
-
this.createdOn = 0;
|
|
19
|
-
this.updatedOn = 0;
|
|
20
|
-
this.createdBy = 0;
|
|
21
|
-
this.updatedBy = 0;
|
|
22
|
-
}
|
|
23
|
-
static fromEntity(entity) {
|
|
24
|
-
const result = new ClientQuoteRateEntityModel(entity_utils_interface_1.EntityEnum.CLIENT_QUOTE_RATE);
|
|
25
|
-
Object.assign(result, entity);
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
28
|
-
getRelationConfigs() {
|
|
29
|
-
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.ClientQuoteRateEntityModel = ClientQuoteRateEntityModel;
|
|
33
|
-
ClientQuoteRateEntityModel.relationConfigs = [];
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
return roleModels.filter((role) => filteredDesignationModels.some((designationModel) => designationModel.name === role.designation));
|
|
21
|
-
}
|
|
22
|
-
static getByCurrency(currency, roleModels) {
|
|
23
|
-
const filteredCurrencyModels = roleModels.filter((role) => role.currency === currency);
|
|
24
|
-
if (filteredCurrencyModels.length === 0) {
|
|
25
|
-
console.warn(`No rate model found for currency: ${currency}. Returning undefined.`);
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
if (filteredCurrencyModels.length > 1) {
|
|
29
|
-
console.warn(`Multiple rate models found for currency: ${currency}. Returning the first matching model.`);
|
|
30
|
-
}
|
|
31
|
-
return filteredCurrencyModels[0];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.RateEntityModel = RateEntityModel;
|