law-common 11.3.21-beta.6 → 11.3.21-beta.7
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/dist/src/api/index.d.ts +2 -0
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/interface/vendor_invoice_advance.create.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/vendor_invoice_advance.create.dto.interface.js +2 -0
- package/dist/src/api/interface/vendor_invoice_advance.update.dto.interface.d.ts +17 -0
- package/dist/src/api/interface/vendor_invoice_advance.update.dto.interface.js +17 -0
- package/dist/src/entities/enums/vendor_invoice_advance_status_enum.d.ts +5 -0
- package/dist/src/entities/enums/vendor_invoice_advance_status_enum.js +9 -0
- package/dist/src/entities/flow-configs/vendor_invoice_advance_flow.config.d.ts +6 -0
- package/dist/src/entities/flow-configs/vendor_invoice_advance_flow.config.js +70 -0
- package/dist/src/entities/index.d.ts +4 -0
- package/dist/src/entities/index.js +4 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +6 -3
- package/dist/src/entities/interface/entity.utils.interface.js +1 -0
- package/dist/src/entities/interface/vendor_invoice_advance.entity.interface.d.ts +11 -0
- package/dist/src/entities/interface/vendor_invoice_advance.entity.interface.js +2 -0
- package/dist/src/entities/model/entity.model.interface.js +2 -0
- package/dist/src/entities/model/vendor_invoice_advance.entity.model.d.ts +69 -0
- package/dist/src/entities/model/vendor_invoice_advance.entity.model.js +237 -0
- package/package.json +1 -1
package/dist/src/api/index.d.ts
CHANGED
|
@@ -111,3 +111,5 @@ export * from "./interface/vendor_tds_challan.create.dto.interface";
|
|
|
111
111
|
export * from "./interface/vendor_tds_challan.update.dto.interface";
|
|
112
112
|
export * from "./interface/vendor_advance.create.dto.interface";
|
|
113
113
|
export * from "./interface/vendor_advance.update.dto.interface";
|
|
114
|
+
export * from "./interface/vendor_invoice_advance.create.dto.interface";
|
|
115
|
+
export * from "./interface/vendor_invoice_advance.update.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -131,3 +131,5 @@ __exportStar(require("./interface/vendor_tds_challan.create.dto.interface"), exp
|
|
|
131
131
|
__exportStar(require("./interface/vendor_tds_challan.update.dto.interface"), exports);
|
|
132
132
|
__exportStar(require("./interface/vendor_advance.create.dto.interface"), exports);
|
|
133
133
|
__exportStar(require("./interface/vendor_advance.update.dto.interface"), exports);
|
|
134
|
+
__exportStar(require("./interface/vendor_invoice_advance.create.dto.interface"), exports);
|
|
135
|
+
__exportStar(require("./interface/vendor_invoice_advance.update.dto.interface"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../entities";
|
|
2
|
+
import { IVendorInvoiceAdvanceEntity } from "../../entities/interface/vendor_invoice_advance.entity.interface";
|
|
3
|
+
export type IVendorInvoiceAdvanceCreateExclude = "status";
|
|
4
|
+
export interface IVendorInvoiceAdvanceCreateDto extends Omit<IEntityCreateDto<IVendorInvoiceAdvanceEntity>, IVendorInvoiceAdvanceCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "./api.utils.interface";
|
|
2
|
+
import { IVendorInvoiceAdvanceCreateDto } from "./vendor_invoice_advance.create.dto.interface";
|
|
3
|
+
export type IVendorInvoiceAdvanceUpdateDto = DeepPartialButRequired<IVendorInvoiceAdvanceCreateDto, never> & {
|
|
4
|
+
actionData: IVendorInvoiceAdvanceActionDataDto;
|
|
5
|
+
};
|
|
6
|
+
export interface IVendorInvoiceAdvanceActionDataDto {
|
|
7
|
+
action: VendorInvoiceAdvanceActionEnum;
|
|
8
|
+
remark?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare enum VendorInvoiceAdvanceActionEnum {
|
|
11
|
+
CREATE = "create",
|
|
12
|
+
UPDATE = "update",
|
|
13
|
+
DELETE = "delete",
|
|
14
|
+
DEACTIVATE = "deactivate",
|
|
15
|
+
ACTIVATE = "activate",
|
|
16
|
+
RESTORE = "restore"
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VendorInvoiceAdvanceActionEnum = void 0;
|
|
4
|
+
var VendorInvoiceAdvanceActionEnum;
|
|
5
|
+
(function (VendorInvoiceAdvanceActionEnum) {
|
|
6
|
+
VendorInvoiceAdvanceActionEnum["CREATE"] = "create";
|
|
7
|
+
VendorInvoiceAdvanceActionEnum["UPDATE"] = "update";
|
|
8
|
+
VendorInvoiceAdvanceActionEnum["DELETE"] = "delete";
|
|
9
|
+
// APPROVE = "approve",
|
|
10
|
+
// REJECT = "reject",
|
|
11
|
+
// RECALL = "recall",
|
|
12
|
+
VendorInvoiceAdvanceActionEnum["DEACTIVATE"] = "deactivate";
|
|
13
|
+
// REQUEST_CHANGES = "request_changes",
|
|
14
|
+
VendorInvoiceAdvanceActionEnum["ACTIVATE"] = "activate";
|
|
15
|
+
VendorInvoiceAdvanceActionEnum["RESTORE"] = "restore";
|
|
16
|
+
// CHANGES_DONE = "changes_done",
|
|
17
|
+
})(VendorInvoiceAdvanceActionEnum || (exports.VendorInvoiceAdvanceActionEnum = VendorInvoiceAdvanceActionEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VendorInvoiceAdvanceStatusEnum = void 0;
|
|
4
|
+
var VendorInvoiceAdvanceStatusEnum;
|
|
5
|
+
(function (VendorInvoiceAdvanceStatusEnum) {
|
|
6
|
+
VendorInvoiceAdvanceStatusEnum["APPROVED"] = "APPROVED";
|
|
7
|
+
VendorInvoiceAdvanceStatusEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
8
|
+
VendorInvoiceAdvanceStatusEnum["DELETED"] = "DELETED";
|
|
9
|
+
})(VendorInvoiceAdvanceStatusEnum || (exports.VendorInvoiceAdvanceStatusEnum = VendorInvoiceAdvanceStatusEnum = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FlowConfig } from "./flow-config.type";
|
|
2
|
+
import { VendorInvoiceAdvanceActionEnum } from "../../api";
|
|
3
|
+
import { VendorInvoiceAdvanceStatusEnum } from "../enums/vendor_invoice_advance_status_enum";
|
|
4
|
+
export interface IVendorInvoiceAdvanceFlowConfigContextData {
|
|
5
|
+
}
|
|
6
|
+
export declare const vendorInvoiceAdvanceFlowConfig: FlowConfig<VendorInvoiceAdvanceStatusEnum, VendorInvoiceAdvanceActionEnum, IVendorInvoiceAdvanceFlowConfigContextData>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vendorInvoiceAdvanceFlowConfig = void 0;
|
|
4
|
+
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
|
+
const api_1 = require("../../api");
|
|
6
|
+
const vendor_invoice_advance_status_enum_1 = require("../enums/vendor_invoice_advance_status_enum");
|
|
7
|
+
const VENDOR_INVOICE_ADVANCE_CREATE_PERMISSION = ["VENDOR_INVOICE_ADVANCE_CREATE"];
|
|
8
|
+
const VENDOR_INVOICE_ADVANCE_UPDATE_PERMISSION = ["VENDOR_INVOICE_ADVANCE_UPDATE"];
|
|
9
|
+
const VENDOR_INVOICE_ADVANCE_DELETE_PERMISSION = ["VENDOR_INVOICE_ADVANCE_DELETE"];
|
|
10
|
+
const VENDOR_INVOICE_ADVANCE_DEACTIVATE_PERMISSION = ["VENDOR_INVOICE_ADVANCE_DEACTIVATE"];
|
|
11
|
+
const VENDOR_INVOICE_ADVANCE_ACTIVATE_PERMISSION = ["VENDOR_INVOICE_ADVANCE_ACTIVATE"];
|
|
12
|
+
const VENDOR_INVOICE_ADVANCE_RESTORE_PERMISSION = ["VENDOR_INVOICE_ADVANCE_RESTORE"];
|
|
13
|
+
const ACTION_MAP = {
|
|
14
|
+
[api_1.VendorInvoiceAdvanceActionEnum.CREATE]: {
|
|
15
|
+
reachableStatues: [vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED],
|
|
16
|
+
permissions: VENDOR_INVOICE_ADVANCE_CREATE_PERMISSION,
|
|
17
|
+
},
|
|
18
|
+
[api_1.VendorInvoiceAdvanceActionEnum.UPDATE]: {
|
|
19
|
+
reachableStatues: [vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED],
|
|
20
|
+
permissions: VENDOR_INVOICE_ADVANCE_UPDATE_PERMISSION,
|
|
21
|
+
},
|
|
22
|
+
[api_1.VendorInvoiceAdvanceActionEnum.DELETE]: {
|
|
23
|
+
reachableStatues: [vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.DELETED],
|
|
24
|
+
permissions: VENDOR_INVOICE_ADVANCE_DELETE_PERMISSION,
|
|
25
|
+
},
|
|
26
|
+
[api_1.VendorInvoiceAdvanceActionEnum.DEACTIVATE]: {
|
|
27
|
+
reachableStatues: [vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.DEACTIVATED],
|
|
28
|
+
permissions: VENDOR_INVOICE_ADVANCE_DEACTIVATE_PERMISSION,
|
|
29
|
+
},
|
|
30
|
+
[api_1.VendorInvoiceAdvanceActionEnum.ACTIVATE]: {
|
|
31
|
+
reachableStatues: [vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED],
|
|
32
|
+
permissions: VENDOR_INVOICE_ADVANCE_ACTIVATE_PERMISSION,
|
|
33
|
+
},
|
|
34
|
+
[api_1.VendorInvoiceAdvanceActionEnum.RESTORE]: {
|
|
35
|
+
reachableStatues: [vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED],
|
|
36
|
+
permissions: VENDOR_INVOICE_ADVANCE_RESTORE_PERMISSION,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
40
|
+
// APPROVED status transitions
|
|
41
|
+
const transitionApprovedStatusUpdateAction = createActionConfig(api_1.VendorInvoiceAdvanceActionEnum.UPDATE, vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED);
|
|
42
|
+
const transitionApprovedStatusDeleteAction = createActionConfig(api_1.VendorInvoiceAdvanceActionEnum.DELETE, vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.DELETED);
|
|
43
|
+
const transitionApprovedStatusDeactivateAction = createActionConfig(api_1.VendorInvoiceAdvanceActionEnum.DEACTIVATE, vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.DEACTIVATED);
|
|
44
|
+
// DEACTIVATED status transitions
|
|
45
|
+
const transitionDeactivatedStatusDeleteAction = createActionConfig(api_1.VendorInvoiceAdvanceActionEnum.DELETE, vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.DELETED);
|
|
46
|
+
const transitionDeactivatedStatusActivateAction = createActionConfig(api_1.VendorInvoiceAdvanceActionEnum.ACTIVATE, vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED);
|
|
47
|
+
// DELETED status transitions
|
|
48
|
+
const transitionDeletedStatusUpdateAction = createActionConfig(api_1.VendorInvoiceAdvanceActionEnum.UPDATE, vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED);
|
|
49
|
+
const transitionDeletedStatusRestoreAction = createActionConfig(api_1.VendorInvoiceAdvanceActionEnum.RESTORE, vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED);
|
|
50
|
+
exports.vendorInvoiceAdvanceFlowConfig = {
|
|
51
|
+
[vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED]: {
|
|
52
|
+
actions: {
|
|
53
|
+
[api_1.VendorInvoiceAdvanceActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
54
|
+
[api_1.VendorInvoiceAdvanceActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
55
|
+
[api_1.VendorInvoiceAdvanceActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
[vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.DEACTIVATED]: {
|
|
59
|
+
actions: {
|
|
60
|
+
[api_1.VendorInvoiceAdvanceActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
61
|
+
[api_1.VendorInvoiceAdvanceActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
[vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.DELETED]: {
|
|
65
|
+
actions: {
|
|
66
|
+
[api_1.VendorInvoiceAdvanceActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
67
|
+
[api_1.VendorInvoiceAdvanceActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -245,3 +245,7 @@ export * from "./enums/vendor_advance_payment_mode";
|
|
|
245
245
|
export * from "./interface/vendor_advance.entity.interface";
|
|
246
246
|
export * from "./model/vendor_advance.entity.model";
|
|
247
247
|
export * from "./flow-configs/vendor_advance_flow.config";
|
|
248
|
+
export * from "./enums/vendor_invoice_advance_status_enum";
|
|
249
|
+
export * from "./interface/vendor_invoice_advance.entity.interface";
|
|
250
|
+
export * from "./model/vendor_invoice_advance.entity.model";
|
|
251
|
+
export * from "./flow-configs/vendor_invoice_advance_flow.config";
|
|
@@ -261,3 +261,7 @@ __exportStar(require("./enums/vendor_advance_payment_mode"), exports);
|
|
|
261
261
|
__exportStar(require("./interface/vendor_advance.entity.interface"), exports);
|
|
262
262
|
__exportStar(require("./model/vendor_advance.entity.model"), exports);
|
|
263
263
|
__exportStar(require("./flow-configs/vendor_advance_flow.config"), exports);
|
|
264
|
+
__exportStar(require("./enums/vendor_invoice_advance_status_enum"), exports);
|
|
265
|
+
__exportStar(require("./interface/vendor_invoice_advance.entity.interface"), exports);
|
|
266
|
+
__exportStar(require("./model/vendor_invoice_advance.entity.model"), exports);
|
|
267
|
+
__exportStar(require("./flow-configs/vendor_invoice_advance_flow.config"), exports);
|
|
@@ -66,6 +66,7 @@ import { VendorEntityModel } from "../model/vendor.entity.model";
|
|
|
66
66
|
import { VendorAdvanceEntityModel } from "../model/vendor_advance.entity.model";
|
|
67
67
|
import { VendorHistoryEntityModel } from "../model/vendor_history.entity.model";
|
|
68
68
|
import { VendorInvoiceEntityModel } from "../model/vendor_invoice.entity.model";
|
|
69
|
+
import { VendorInvoiceAdvanceEntityModel } from "../model/vendor_invoice_advance.entity.model";
|
|
69
70
|
import { VendorInvoiceHistoryEntityModel } from "../model/vendor_invoice_history.entity.model";
|
|
70
71
|
import { VendorInvoiceItemEntityModel } from "../model/vendor_invoice_item.entity.model";
|
|
71
72
|
import { VendorInvoiceItemHistoryEntityModel } from "../model/vendor_invoice_item_history.entity.model";
|
|
@@ -138,6 +139,7 @@ import { IVendorInvoiceItemHistoryEntity } from "./vendor-invoice-item-history.e
|
|
|
138
139
|
import { IVendorEntity } from "./vendor.entity.interface";
|
|
139
140
|
import { IVendorAdvanceEntity } from "./vendor_advance.entity.interface";
|
|
140
141
|
import { IVendorInvoiceEntity } from "./vendor_invoice.entity.interface";
|
|
142
|
+
import { IVendorInvoiceAdvanceEntity } from "./vendor_invoice_advance.entity.interface";
|
|
141
143
|
import { IVendorInvoiceItemEntity } from "./vendor_invoice_item.entity.interface";
|
|
142
144
|
import { IVendorInvoicePaymentEntity } from "./vendor_invoice_payment.entity.interface";
|
|
143
145
|
import { IVendorTdsChallanEntity } from "./vendor_tds_challan.entity.interface";
|
|
@@ -258,7 +260,8 @@ export declare enum EntityEnum {
|
|
|
258
260
|
LEAVE_APPROVAL = "leave_approval",
|
|
259
261
|
VENDOR_TDS_LIABILITY = "vendor_tds_liability",
|
|
260
262
|
VENDOR_TDS_CHALLAN = "vendor_tds_challan",
|
|
261
|
-
VENDOR_ADVANCE = "vendor_advance"
|
|
263
|
+
VENDOR_ADVANCE = "vendor_advance",
|
|
264
|
+
VENDOR_INVOICE_ADVANCE = "vendor_invoice_advance"
|
|
262
265
|
}
|
|
263
266
|
export type EntityRelations = {
|
|
264
267
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -283,7 +286,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
283
286
|
[key in EntityEnum | VirtualEntityEnum]?: AggregationFields<EnumToModel<key>>[];
|
|
284
287
|
};
|
|
285
288
|
};
|
|
286
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.MOVING_TIMESHEET ? IMovingTimesheetEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.BILLING_PROFILE ? IBillingProfileEntity : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? IProjectRevenueSplitMappingEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.ENTITY_HISTORY ? IEntityHistoryEntity : T extends EntityEnum.LEAVE_APPROVAL ? ILeaveApprovalEntity : T extends EntityEnum.VENDOR_INVOICE_PAYMENT ? IVendorInvoicePaymentEntity : T extends EntityEnum.VENDOR_TDS_LIABILITY ? IVendorTdsLiabilityEntity : T extends EntityEnum.VENDOR_TDS_CHALLAN ? IVendorTdsChallanEntity : T extends EntityEnum.VENDOR_ADVANCE ? IVendorAdvanceEntity : never) & {
|
|
289
|
+
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.MOVING_TIMESHEET ? IMovingTimesheetEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.BILLING_PROFILE ? IBillingProfileEntity : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? IProjectRevenueSplitMappingEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.ENTITY_HISTORY ? IEntityHistoryEntity : T extends EntityEnum.LEAVE_APPROVAL ? ILeaveApprovalEntity : T extends EntityEnum.VENDOR_INVOICE_PAYMENT ? IVendorInvoicePaymentEntity : T extends EntityEnum.VENDOR_TDS_LIABILITY ? IVendorTdsLiabilityEntity : T extends EntityEnum.VENDOR_TDS_CHALLAN ? IVendorTdsChallanEntity : T extends EntityEnum.VENDOR_ADVANCE ? IVendorAdvanceEntity : T extends EntityEnum.VENDOR_INVOICE_ADVANCE ? IVendorInvoiceAdvanceEntity : never) & {
|
|
287
290
|
id: number;
|
|
288
291
|
};
|
|
289
292
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -415,7 +418,7 @@ export declare enum VirtualEntityEnum {
|
|
|
415
418
|
}
|
|
416
419
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
417
420
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
418
|
-
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.MOVING_TIMESHEET ? MovingTimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.BILLING_PROFILE ? BillingProfileEntityModel : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? ProjectRevenueSplitMappingEntityModel : 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 : T extends EntityEnum.ENTITY_HISTORY ? EntityHistoryEntityModel : T extends EntityEnum.LEAVE_APPROVAL ? LeaveApprovalEntityModel : T extends EntityEnum.VENDOR_INVOICE_PAYMENT ? VendorInvoicePaymentEntityModel : T extends EntityEnum.VENDOR_TDS_LIABILITY ? VendorTdsLiabilityEntityModel : T extends EntityEnum.VENDOR_TDS_CHALLAN ? VendorTdsChallanEntityModel : T extends EntityEnum.VENDOR_ADVANCE ? VendorAdvanceEntityModel : UserEntityModel;
|
|
421
|
+
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.MOVING_TIMESHEET ? MovingTimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.BILLING_PROFILE ? BillingProfileEntityModel : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? ProjectRevenueSplitMappingEntityModel : 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 : T extends EntityEnum.ENTITY_HISTORY ? EntityHistoryEntityModel : T extends EntityEnum.LEAVE_APPROVAL ? LeaveApprovalEntityModel : T extends EntityEnum.VENDOR_INVOICE_PAYMENT ? VendorInvoicePaymentEntityModel : T extends EntityEnum.VENDOR_TDS_LIABILITY ? VendorTdsLiabilityEntityModel : T extends EntityEnum.VENDOR_TDS_CHALLAN ? VendorTdsChallanEntityModel : T extends EntityEnum.VENDOR_ADVANCE ? VendorAdvanceEntityModel : T extends EntityEnum.VENDOR_INVOICE_ADVANCE ? VendorInvoiceAdvanceEntityModel : UserEntityModel;
|
|
419
422
|
export type EntityMap = {
|
|
420
423
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
421
424
|
} & {
|
|
@@ -105,6 +105,7 @@ var EntityEnum;
|
|
|
105
105
|
EntityEnum["VENDOR_TDS_LIABILITY"] = "vendor_tds_liability";
|
|
106
106
|
EntityEnum["VENDOR_TDS_CHALLAN"] = "vendor_tds_challan";
|
|
107
107
|
EntityEnum["VENDOR_ADVANCE"] = "vendor_advance";
|
|
108
|
+
EntityEnum["VENDOR_INVOICE_ADVANCE"] = "vendor_invoice_advance";
|
|
108
109
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
109
110
|
var VirtualEntityEnum;
|
|
110
111
|
(function (VirtualEntityEnum) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { VendorInvoiceAdvanceStatusEnum } from "../enums/vendor_invoice_advance_status_enum";
|
|
3
|
+
export interface IVendorInvoiceAdvanceEntity extends IEntityAuditColumn {
|
|
4
|
+
id: number;
|
|
5
|
+
date: number;
|
|
6
|
+
amount: number;
|
|
7
|
+
vendorInvoiceId: number;
|
|
8
|
+
vendorAdvanceId: number;
|
|
9
|
+
vendorId: number;
|
|
10
|
+
status: VendorInvoiceAdvanceStatusEnum;
|
|
11
|
+
}
|
|
@@ -73,6 +73,7 @@ const vendor_entity_model_1 = require("./vendor.entity.model");
|
|
|
73
73
|
const vendor_advance_entity_model_1 = require("./vendor_advance.entity.model");
|
|
74
74
|
const vendor_history_entity_model_1 = require("./vendor_history.entity.model");
|
|
75
75
|
const vendor_invoice_entity_model_1 = require("./vendor_invoice.entity.model");
|
|
76
|
+
const vendor_invoice_advance_entity_model_1 = require("./vendor_invoice_advance.entity.model");
|
|
76
77
|
const vendor_invoice_history_entity_model_1 = require("./vendor_invoice_history.entity.model");
|
|
77
78
|
const vendor_invoice_item_entity_model_1 = require("./vendor_invoice_item.entity.model");
|
|
78
79
|
const vendor_invoice_item_history_entity_model_1 = require("./vendor_invoice_item_history.entity.model");
|
|
@@ -186,6 +187,7 @@ exports.entityEnumToEntityModel = {
|
|
|
186
187
|
[entity_utils_interface_1.EntityEnum.VENDOR_TDS_LIABILITY]: vendor_tds_liability_entity_model_1.VendorTdsLiabilityEntityModel.fromEntity,
|
|
187
188
|
[entity_utils_interface_1.EntityEnum.VENDOR_TDS_CHALLAN]: vendor_tds_challan_entity_model_1.VendorTdsChallanEntityModel.fromEntity,
|
|
188
189
|
[entity_utils_interface_1.EntityEnum.VENDOR_ADVANCE]: vendor_advance_entity_model_1.VendorAdvanceEntityModel.fromEntity,
|
|
190
|
+
[entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_ADVANCE]: vendor_invoice_advance_entity_model_1.VendorInvoiceAdvanceEntityModel.fromEntity,
|
|
189
191
|
};
|
|
190
192
|
function entityMapToModels(entityMap) {
|
|
191
193
|
for (const entityName in entityMap) {
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { IUserEntity } from "../interface/user.entity.interface";
|
|
5
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
6
|
+
import { IRowActions } from "./interface/row-actions.interface";
|
|
7
|
+
import { IVendorInvoiceAdvanceEntity } from "../interface/vendor_invoice_advance.entity.interface";
|
|
8
|
+
import { VendorInvoiceAdvanceStatusEnum } from "../enums/vendor_invoice_advance_status_enum";
|
|
9
|
+
import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
|
|
10
|
+
import { VendorAdvanceEntityModel } from "./vendor_advance.entity.model";
|
|
11
|
+
import { VendorEntityModel } from "./vendor.entity.model";
|
|
12
|
+
import { StateEntityModel } from "./state.entity.model";
|
|
13
|
+
import { CountryEntityModel } from "./country.entity.model";
|
|
14
|
+
import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
|
|
15
|
+
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
16
|
+
import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
|
|
17
|
+
import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
|
|
18
|
+
import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
|
|
19
|
+
import { GstRateEntityModel } from "./gst_rate.entity.model";
|
|
20
|
+
import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
|
|
21
|
+
import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
|
|
22
|
+
import { BankEntityModel } from "./bank.entity.model";
|
|
23
|
+
import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
24
|
+
import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
|
|
25
|
+
import { VendorInvoiceAdvanceActionEnum } from "../../api";
|
|
26
|
+
import { IVendorInvoiceAdvanceFlowConfigContextData } from "../flow-configs/vendor_invoice_advance_flow.config";
|
|
27
|
+
export declare class VendorInvoiceAdvanceEntityModel extends BaseEntityModel<EntityEnum.VENDOR_INVOICE_ADVANCE> implements IVendorInvoiceAdvanceEntity {
|
|
28
|
+
id: number;
|
|
29
|
+
date: number;
|
|
30
|
+
amount: number;
|
|
31
|
+
vendorInvoiceId: number;
|
|
32
|
+
vendorAdvanceId: number;
|
|
33
|
+
vendorId: number;
|
|
34
|
+
status: VendorInvoiceAdvanceStatusEnum;
|
|
35
|
+
createdOn: number;
|
|
36
|
+
updatedOn: number;
|
|
37
|
+
createdBy: number;
|
|
38
|
+
updatedBy: number;
|
|
39
|
+
vendorInvoice?: VendorInvoiceEntityModel;
|
|
40
|
+
vendorAdvance?: VendorAdvanceEntityModel;
|
|
41
|
+
vendor?: VendorEntityModel;
|
|
42
|
+
static relationConfigs: RelationConfigs<[EntityEnum.VENDOR_INVOICE, EntityEnum.VENDOR_ADVANCE, EntityEnum.VENDOR], EntityEnum.VENDOR_INVOICE_ADVANCE>;
|
|
43
|
+
static fromEntity(entity: IVendorInvoiceAdvanceEntity): VendorInvoiceAdvanceEntityModel;
|
|
44
|
+
getRelationConfigs(): any[];
|
|
45
|
+
get state(): StateEntityModel | undefined;
|
|
46
|
+
get country(): CountryEntityModel | undefined;
|
|
47
|
+
get organizationType(): OrganizationTypeEntityModel | undefined;
|
|
48
|
+
get tdsRate(): TdsRateEntityModel | undefined;
|
|
49
|
+
get voucherTypes(): VoucherTypeEntityModel[] | undefined;
|
|
50
|
+
get expenseHeads(): ExpenseHeadEntityModel[] | undefined;
|
|
51
|
+
get vendorInvoiceItems(): VendorInvoiceItemEntityModel[] | undefined;
|
|
52
|
+
get gstRate(): GstRateEntityModel | undefined;
|
|
53
|
+
get vendorTdsLiabilitys(): VendorTdsLiabilityEntityModel[] | undefined;
|
|
54
|
+
get vendorTdsChallans(): VendorTdsChallanEntityModel[] | undefined;
|
|
55
|
+
get banks(): BankEntityModel[] | undefined;
|
|
56
|
+
get officeLocation(): OfficeLocationEntityModel | undefined;
|
|
57
|
+
get vendorInvoicePayments(): VendorInvoicePaymentEntityModel[] | undefined;
|
|
58
|
+
getNextStatus(currentUser: IUserEntity, action: VendorInvoiceAdvanceActionEnum, vendorInvoiceAdvanceFlowConfigContextData: IVendorInvoiceAdvanceFlowConfigContextData): VendorInvoiceAdvanceStatusEnum;
|
|
59
|
+
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
60
|
+
combinedActions?: Record<string, {
|
|
61
|
+
combineActions: VendorInvoiceAdvanceActionEnum[];
|
|
62
|
+
label: string;
|
|
63
|
+
}>;
|
|
64
|
+
customLabels?: Partial<Record<VendorInvoiceAdvanceActionEnum, string>>;
|
|
65
|
+
}): IRowActions<EntityEnum.VENDOR_INVOICE_ADVANCE>[];
|
|
66
|
+
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
67
|
+
[key: string]: () => boolean;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VendorInvoiceAdvanceEntityModel = 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 exceptions_1 = require("../../exceptions");
|
|
8
|
+
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const vendor_invoice_advance_status_enum_1 = require("../enums/vendor_invoice_advance_status_enum");
|
|
11
|
+
const vendor_invoice_advance_flow_config_1 = require("../flow-configs/vendor_invoice_advance_flow.config");
|
|
12
|
+
class VendorInvoiceAdvanceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.id = 0;
|
|
16
|
+
this.date = 0;
|
|
17
|
+
this.amount = 0;
|
|
18
|
+
this.vendorInvoiceId = 0;
|
|
19
|
+
this.vendorAdvanceId = 0;
|
|
20
|
+
this.vendorId = 0;
|
|
21
|
+
this.status = vendor_invoice_advance_status_enum_1.VendorInvoiceAdvanceStatusEnum.APPROVED;
|
|
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 VendorInvoiceAdvanceEntityModel(entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_ADVANCE);
|
|
29
|
+
Object.assign(result, entity);
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
getRelationConfigs() {
|
|
33
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
34
|
+
}
|
|
35
|
+
get state() {
|
|
36
|
+
// many_to_one -> many_to_one verified
|
|
37
|
+
// {'vendor_invoice_advance->vendor': 'many_to_one', 'vendor->state': 'many_to_one'}
|
|
38
|
+
// ['vendor_invoice_advance', 'vendor'] -> many_to_one
|
|
39
|
+
// ['vendor', 'state'] -> many_to_one
|
|
40
|
+
var _a;
|
|
41
|
+
return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.stateModel;
|
|
42
|
+
}
|
|
43
|
+
get country() {
|
|
44
|
+
// many_to_one -> many_to_one verified
|
|
45
|
+
// {'vendor_invoice_advance->vendor': 'many_to_one', 'vendor->country': 'many_to_one'}
|
|
46
|
+
// ['vendor_invoice_advance', 'vendor'] -> many_to_one
|
|
47
|
+
// ['vendor', 'country'] -> many_to_one
|
|
48
|
+
var _a;
|
|
49
|
+
return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.countryModel;
|
|
50
|
+
}
|
|
51
|
+
get organizationType() {
|
|
52
|
+
// many_to_one -> many_to_one verified
|
|
53
|
+
// {'vendor_invoice_advance->vendor': 'many_to_one', 'vendor->organization_type': 'many_to_one'}
|
|
54
|
+
// ['vendor_invoice_advance', 'vendor'] -> many_to_one
|
|
55
|
+
// ['vendor', 'organization_type'] -> many_to_one
|
|
56
|
+
var _a;
|
|
57
|
+
return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.organizationType;
|
|
58
|
+
}
|
|
59
|
+
get tdsRate() {
|
|
60
|
+
// many_to_one -> many_to_one verified
|
|
61
|
+
// {'vendor_invoice_advance->vendor_advance': 'many_to_one', 'vendor_advance->tds_rate': 'many_to_one'}
|
|
62
|
+
// ['vendor_invoice_advance', 'vendor_advance'] -> many_to_one
|
|
63
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
64
|
+
var _a;
|
|
65
|
+
return (_a = this.vendorAdvance) === null || _a === void 0 ? void 0 : _a.tdsRate;
|
|
66
|
+
}
|
|
67
|
+
get voucherTypes() {
|
|
68
|
+
// many_to_many -> many_to_many verified
|
|
69
|
+
// {'vendor_invoice_advance->vendor_advance': 'many_to_one', 'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->voucher_type': 'many_to_many'}
|
|
70
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
71
|
+
// ['tds_rate', 'voucher_type'] -> many_to_many
|
|
72
|
+
var _a;
|
|
73
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.voucherTypes;
|
|
74
|
+
}
|
|
75
|
+
get expenseHeads() {
|
|
76
|
+
// many_to_many -> many_to_many verified
|
|
77
|
+
// {'vendor_invoice_advance->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor_invoice_item': 'one_to_many', 'vendor_invoice_item->expense_head': 'many_to_one'}
|
|
78
|
+
// ['vendor_invoice', 'vendor_invoice_item'] -> one_to_many
|
|
79
|
+
// ['vendor_invoice_item', 'expense_head'] -> many_to_one
|
|
80
|
+
var _a;
|
|
81
|
+
return (_a = this.vendorInvoiceItems) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoiceItem) => vendorInvoiceItem.expenseHead).filter((expenseHead) => !!expenseHead).reduce((accumulator, current) => {
|
|
82
|
+
if (!accumulator.some((expenseHead) => expenseHead.id === current.id)) {
|
|
83
|
+
accumulator.push(current);
|
|
84
|
+
}
|
|
85
|
+
return accumulator;
|
|
86
|
+
}, []);
|
|
87
|
+
}
|
|
88
|
+
get vendorInvoiceItems() {
|
|
89
|
+
// many_to_many -> many_to_many verified
|
|
90
|
+
// {'vendor_invoice_advance->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor_invoice_item': 'one_to_many'}
|
|
91
|
+
// ['vendor_invoice_advance', 'vendor_invoice'] -> many_to_one
|
|
92
|
+
// ['vendor_invoice', 'vendor_invoice_item'] -> one_to_many
|
|
93
|
+
var _a;
|
|
94
|
+
return (_a = this.vendorInvoice) === null || _a === void 0 ? void 0 : _a.vendorInvoiceItems;
|
|
95
|
+
}
|
|
96
|
+
get gstRate() {
|
|
97
|
+
// many_to_one -> many_to_one verified
|
|
98
|
+
// {'vendor_invoice_advance->vendor_advance': 'many_to_one', 'vendor_advance->gst_rate': 'many_to_one'}
|
|
99
|
+
// ['vendor_invoice_advance', 'vendor_advance'] -> many_to_one
|
|
100
|
+
// ['vendor_advance', 'gst_rate'] -> many_to_one
|
|
101
|
+
var _a;
|
|
102
|
+
return (_a = this.vendorAdvance) === null || _a === void 0 ? void 0 : _a.gstRate;
|
|
103
|
+
}
|
|
104
|
+
get vendorTdsLiabilitys() {
|
|
105
|
+
// many_to_many -> many_to_many verified
|
|
106
|
+
// {'vendor_invoice_advance->vendor_advance': 'many_to_one', 'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_liability': 'one_to_many'}
|
|
107
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
108
|
+
// ['tds_rate', 'vendor_tds_liability'] -> one_to_many
|
|
109
|
+
var _a;
|
|
110
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.vendorTdsLiabilitys;
|
|
111
|
+
}
|
|
112
|
+
get vendorTdsChallans() {
|
|
113
|
+
// many_to_many -> many_to_many verified
|
|
114
|
+
// {'vendor_invoice_advance->vendor_advance': 'many_to_one', 'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_challan': 'one_to_many'}
|
|
115
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
116
|
+
// ['tds_rate', 'vendor_tds_challan'] -> one_to_many
|
|
117
|
+
var _a;
|
|
118
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.vendorTdsChallans;
|
|
119
|
+
}
|
|
120
|
+
get banks() {
|
|
121
|
+
// many_to_many -> many_to_many verified
|
|
122
|
+
// {'vendor_invoice_advance->vendor_advance': 'many_to_one', 'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->bank': 'many_to_one'}
|
|
123
|
+
// ['tds_rate', 'vendor_tds_challan'] -> one_to_many
|
|
124
|
+
// ['vendor_tds_challan', 'bank'] -> many_to_one
|
|
125
|
+
var _a;
|
|
126
|
+
return (_a = this.vendorTdsChallans) === null || _a === void 0 ? void 0 : _a.flatMap((vendorTdsChallan) => vendorTdsChallan.bank).filter((bank) => !!bank).reduce((accumulator, current) => {
|
|
127
|
+
if (!accumulator.some((bank) => bank.id === current.id)) {
|
|
128
|
+
accumulator.push(current);
|
|
129
|
+
}
|
|
130
|
+
return accumulator;
|
|
131
|
+
}, []);
|
|
132
|
+
}
|
|
133
|
+
get officeLocation() {
|
|
134
|
+
// many_to_one -> many_to_one verified
|
|
135
|
+
// {'vendor_invoice_advance->vendor_invoice': 'many_to_one', 'vendor_invoice->office_location': 'many_to_one'}
|
|
136
|
+
// ['vendor_invoice_advance', 'vendor_invoice'] -> many_to_one
|
|
137
|
+
// ['vendor_invoice', 'office_location'] -> many_to_one
|
|
138
|
+
var _a;
|
|
139
|
+
return (_a = this.vendorInvoice) === null || _a === void 0 ? void 0 : _a.officeLocation;
|
|
140
|
+
}
|
|
141
|
+
get vendorInvoicePayments() {
|
|
142
|
+
// many_to_many -> many_to_many verified
|
|
143
|
+
// {'vendor_invoice_advance->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor_invoice_payment': 'one_to_many'}
|
|
144
|
+
// ['vendor_invoice_advance', 'vendor_invoice'] -> many_to_one
|
|
145
|
+
// ['vendor_invoice', 'vendor_invoice_payment'] -> one_to_many
|
|
146
|
+
var _a;
|
|
147
|
+
return (_a = this.vendorInvoice) === null || _a === void 0 ? void 0 : _a.vendorInvoicePayments;
|
|
148
|
+
}
|
|
149
|
+
getNextStatus(currentUser, action, vendorInvoiceAdvanceFlowConfigContextData) {
|
|
150
|
+
if (!this.status) {
|
|
151
|
+
throw new exceptions_1.AppBadRequestException({
|
|
152
|
+
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
153
|
+
message: [`Status not found: ${this.status}`],
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
const flowForStatus = vendor_invoice_advance_flow_config_1.vendorInvoiceAdvanceFlowConfig[this.status];
|
|
157
|
+
if (!flowForStatus) {
|
|
158
|
+
throw new exceptions_1.AppBadRequestException({
|
|
159
|
+
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
160
|
+
message: [`No flow configuration found for status: ${this.status}`],
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (!action) {
|
|
164
|
+
throw new exceptions_1.AppBadRequestException({
|
|
165
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION_DATA,
|
|
166
|
+
message: ["actionData is required"],
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const matchingPermissionConfig = flowForStatus.actions[action];
|
|
170
|
+
if (!matchingPermissionConfig) {
|
|
171
|
+
throw new exceptions_1.AppBadRequestException({
|
|
172
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION,
|
|
173
|
+
message: [`Action '${action}' is not valid for the current status.`],
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
177
|
+
throw new exceptions_1.AppBadRequestException({
|
|
178
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSIONS,
|
|
179
|
+
message: ["Permission not available for currentUser"],
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
const hasPermission = matchingPermissionConfig.permissions.some((permission) => currentUser.permissions.includes(permission));
|
|
183
|
+
if (!hasPermission) {
|
|
184
|
+
throw new exceptions_1.AppBadRequestException({
|
|
185
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
186
|
+
message: [`Current user does not have permission to ${action} vendorInvoiceAdvance`],
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
const nextStatus = matchingPermissionConfig.next(vendorInvoiceAdvanceFlowConfigContextData);
|
|
190
|
+
return nextStatus;
|
|
191
|
+
}
|
|
192
|
+
getAvailableActions(currentUser, config) {
|
|
193
|
+
var _a;
|
|
194
|
+
const params = {
|
|
195
|
+
flowConfig: vendor_invoice_advance_flow_config_1.vendorInvoiceAdvanceFlowConfig,
|
|
196
|
+
currentStatus: this.status,
|
|
197
|
+
userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
|
|
198
|
+
visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
199
|
+
combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
|
|
200
|
+
customLabels: config === null || config === void 0 ? void 0 : config.customLabels,
|
|
201
|
+
};
|
|
202
|
+
return utils_1.EntityActionFlowResolverV2.getAvailableActionsData(params);
|
|
203
|
+
}
|
|
204
|
+
getUpdateActionVisibility(currentUser) {
|
|
205
|
+
return {};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.VendorInvoiceAdvanceEntityModel = VendorInvoiceAdvanceEntityModel;
|
|
209
|
+
VendorInvoiceAdvanceEntityModel.relationConfigs = [
|
|
210
|
+
{
|
|
211
|
+
name: entity_utils_interface_1.EntityEnum.VENDOR_INVOICE,
|
|
212
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
213
|
+
key: "vendorInvoice",
|
|
214
|
+
mapKeyConfig: {
|
|
215
|
+
relationKey: "id",
|
|
216
|
+
key: "vendorInvoiceId",
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: entity_utils_interface_1.EntityEnum.VENDOR_ADVANCE,
|
|
221
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
222
|
+
key: "vendorAdvance",
|
|
223
|
+
mapKeyConfig: {
|
|
224
|
+
relationKey: "id",
|
|
225
|
+
key: "vendorAdvanceId",
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: entity_utils_interface_1.EntityEnum.VENDOR,
|
|
230
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
231
|
+
key: "vendor",
|
|
232
|
+
mapKeyConfig: {
|
|
233
|
+
relationKey: "id",
|
|
234
|
+
key: "vendorId",
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
];
|