law-common 10.63.4-beta.4 → 10.63.4-beta.6
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.
|
@@ -16,6 +16,7 @@ import { ClientQuoteEntityModel } from "../model/client_quote.entity.model";
|
|
|
16
16
|
import { ClientQuoteRateEntityModel } from "../model/client_quote_rate.entity.model";
|
|
17
17
|
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
18
18
|
import { CountryEntityModel } from "../model/country.entity.model";
|
|
19
|
+
import { DesignationEntityModel } from "../model/designation.entity.model";
|
|
19
20
|
import { DocumentUploadEntityModel } from "../model/document_upload.entity.model";
|
|
20
21
|
import { ExpenseHeadEntityModel } from "../model/expense_head.entity.model";
|
|
21
22
|
import { GstRateEntityModel } from "../model/gst_rate.entity.model";
|
|
@@ -349,7 +350,7 @@ export declare enum VirtualEntityEnum {
|
|
|
349
350
|
}
|
|
350
351
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
351
352
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
352
|
-
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 : UserEntityModel;
|
|
353
|
+
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 : UserEntityModel;
|
|
353
354
|
export type EntityMap = {
|
|
354
355
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
355
356
|
};
|
|
@@ -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");
|
|
@@ -120,11 +123,14 @@ exports.entityEnumToEntityModel = {
|
|
|
120
123
|
[entity_utils_interface_1.EntityEnum.OFFICE_LOCATION]: office_location_entity_model_1.OfficeLocationEntityModel.fromEntity,
|
|
121
124
|
[entity_utils_interface_1.EntityEnum.WEBSITE_LEAD]: website_lead_entity_model_1.WebsiteLeadEntityModel.fromEntity,
|
|
122
125
|
[entity_utils_interface_1.EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION]: website_newsletter_subscription_entity_model_1.WebsiteNewsletterSubscriptionEntityModel.fromEntity,
|
|
126
|
+
[entity_utils_interface_1.EntityEnum.CLIENT_QUOTE]: client_quote_entity_model_1.ClientQuoteEntityModel.fromEntity,
|
|
127
|
+
[entity_utils_interface_1.EntityEnum.CLIENT_QUOTE_RATE]: client_quote_rate_entity_model_1.ClientQuoteRateEntityModel.fromEntity,
|
|
128
|
+
[entity_utils_interface_1.EntityEnum.DESIGNATION]: designation_entity_model_1.DesignationEntityModel.fromEntity,
|
|
123
129
|
};
|
|
124
130
|
function entityMapToModels(entityMap) {
|
|
125
131
|
for (const entityName in entityMap) {
|
|
126
132
|
if (!(entityName in exports.entityEnumToEntityModel)) {
|
|
127
|
-
throw new Error(`
|
|
133
|
+
throw new Error(`Mapping not found for entity: ${entityName} found in entityMapToModels function of law-common entity.model.interface.ts`);
|
|
128
134
|
}
|
|
129
135
|
entityMap[entityName] = entityMap[entityName].map((entity) => exports.entityEnumToEntityModel[entityName](
|
|
130
136
|
// @ts-ignore
|