law-common 11.3.10-beta.0 → 11.3.11

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.
Files changed (27) hide show
  1. package/dist/src/api/index.d.ts +2 -0
  2. package/dist/src/api/index.js +2 -0
  3. package/dist/src/api/interface/vendor_tds_challan.create.dto.interface.d.ts +5 -0
  4. package/dist/src/api/interface/vendor_tds_challan.create.dto.interface.js +2 -0
  5. package/dist/src/api/interface/vendor_tds_challan.update.dto.interface.d.ts +17 -0
  6. package/dist/src/api/interface/vendor_tds_challan.update.dto.interface.js +17 -0
  7. package/dist/src/entities/enums/vendor_tds_challan_status_enum.d.ts +5 -0
  8. package/dist/src/entities/enums/vendor_tds_challan_status_enum.js +9 -0
  9. package/dist/src/entities/flow-configs/vendor_tds_challan_flow.config.d.ts +6 -0
  10. package/dist/src/entities/flow-configs/vendor_tds_challan_flow.config.js +70 -0
  11. package/dist/src/entities/index.d.ts +4 -0
  12. package/dist/src/entities/index.js +4 -0
  13. package/dist/src/entities/interface/entity.utils.interface.d.ts +6 -3
  14. package/dist/src/entities/interface/entity.utils.interface.js +1 -0
  15. package/dist/src/entities/interface/vendor_tds_challan.entity.interface.d.ts +15 -0
  16. package/dist/src/entities/interface/vendor_tds_challan.entity.interface.js +2 -0
  17. package/dist/src/entities/model/entity.model.interface.js +2 -0
  18. package/dist/src/entities/model/tds_rate.entity.model.autocode.js +225 -1
  19. package/dist/src/entities/model/tds_rate.entity.model.d.ts +7 -1
  20. package/dist/src/entities/model/tds_rate.entity.model.js +18 -0
  21. package/dist/src/entities/model/vendor_invoice.entity.model.d.ts +8 -1
  22. package/dist/src/entities/model/vendor_invoice.entity.model.js +9 -0
  23. package/dist/src/entities/model/vendor_tds_challan.entity.model.d.ts +68 -0
  24. package/dist/src/entities/model/vendor_tds_challan.entity.model.js +251 -0
  25. package/dist/src/entities/model/vendor_tds_liability.entity.model.d.ts +1 -0
  26. package/dist/src/entities/model/vendor_tds_liability.entity.model.js +6 -0
  27. package/package.json +1 -1
@@ -107,3 +107,5 @@ export * from "./interface/leave_approval.create.dto.interface";
107
107
  export * from "./interface/leave_approval.update.dto.interface";
108
108
  export * from "./interface/vendor_tds_liability.create.dto.interface";
109
109
  export * from "./interface/vendor_tds_liability.update.dto.interface";
110
+ export * from "./interface/vendor_tds_challan.create.dto.interface";
111
+ export * from "./interface/vendor_tds_challan.update.dto.interface";
@@ -127,3 +127,5 @@ __exportStar(require("./interface/leave_approval.create.dto.interface"), exports
127
127
  __exportStar(require("./interface/leave_approval.update.dto.interface"), exports);
128
128
  __exportStar(require("./interface/vendor_tds_liability.create.dto.interface"), exports);
129
129
  __exportStar(require("./interface/vendor_tds_liability.update.dto.interface"), exports);
130
+ __exportStar(require("./interface/vendor_tds_challan.create.dto.interface"), exports);
131
+ __exportStar(require("./interface/vendor_tds_challan.update.dto.interface"), exports);
@@ -0,0 +1,5 @@
1
+ import { IEntityCreateDto } from "../../entities";
2
+ import { IVendorTdsChallanEntity } from "../../entities/interface/vendor_tds_challan.entity.interface";
3
+ export type IVendorTdsChallanCreateExclude = "status";
4
+ export interface IVendorTdsChallanCreateDto extends Omit<IEntityCreateDto<IVendorTdsChallanEntity>, IVendorTdsChallanCreateExclude> {
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { DeepPartialButRequired } from "./api.utils.interface";
2
+ import { IVendorTdsChallanCreateDto } from "./vendor_tds_challan.create.dto.interface";
3
+ export type IVendorTdsChallanUpdateDto = DeepPartialButRequired<IVendorTdsChallanCreateDto, never> & {
4
+ actionData: IVendorTdsChallanActionDataDto;
5
+ };
6
+ export interface IVendorTdsChallanActionDataDto {
7
+ action: VendorTdsChallanActionEnum;
8
+ remark?: string;
9
+ }
10
+ export declare enum VendorTdsChallanActionEnum {
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.VendorTdsChallanActionEnum = void 0;
4
+ var VendorTdsChallanActionEnum;
5
+ (function (VendorTdsChallanActionEnum) {
6
+ VendorTdsChallanActionEnum["CREATE"] = "create";
7
+ VendorTdsChallanActionEnum["UPDATE"] = "update";
8
+ VendorTdsChallanActionEnum["DELETE"] = "delete";
9
+ // APPROVE = "approve",
10
+ // REJECT = "reject",
11
+ // RECALL = "recall",
12
+ VendorTdsChallanActionEnum["DEACTIVATE"] = "deactivate";
13
+ // REQUEST_CHANGES = "request_changes",
14
+ VendorTdsChallanActionEnum["ACTIVATE"] = "activate";
15
+ VendorTdsChallanActionEnum["RESTORE"] = "restore";
16
+ // CHANGES_DONE = "changes_done",
17
+ })(VendorTdsChallanActionEnum || (exports.VendorTdsChallanActionEnum = VendorTdsChallanActionEnum = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum VendorTdsChallanStatusEnum {
2
+ APPROVED = "APPROVED",
3
+ DEACTIVATED = "DEACTIVATED",
4
+ DELETED = "DELETED"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VendorTdsChallanStatusEnum = void 0;
4
+ var VendorTdsChallanStatusEnum;
5
+ (function (VendorTdsChallanStatusEnum) {
6
+ VendorTdsChallanStatusEnum["APPROVED"] = "APPROVED";
7
+ VendorTdsChallanStatusEnum["DEACTIVATED"] = "DEACTIVATED";
8
+ VendorTdsChallanStatusEnum["DELETED"] = "DELETED";
9
+ })(VendorTdsChallanStatusEnum || (exports.VendorTdsChallanStatusEnum = VendorTdsChallanStatusEnum = {}));
@@ -0,0 +1,6 @@
1
+ import { FlowConfig } from "./flow-config.type";
2
+ import { VendorTdsChallanActionEnum } from "../../api";
3
+ import { VendorTdsChallanStatusEnum } from "../enums/vendor_tds_challan_status_enum";
4
+ export interface IVendorTdsChallanFlowConfigContextData {
5
+ }
6
+ export declare const vendorTdsChallanFlowConfig: FlowConfig<VendorTdsChallanStatusEnum, VendorTdsChallanActionEnum, IVendorTdsChallanFlowConfigContextData>;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vendorTdsChallanFlowConfig = void 0;
4
+ const base_flow_config_factory_1 = require("./base-flow-config.factory");
5
+ const api_1 = require("../../api");
6
+ const vendor_tds_challan_status_enum_1 = require("../enums/vendor_tds_challan_status_enum");
7
+ const VENDOR_TDS_CHALLAN_CREATE_PERMISSION = ["VENDOR_TDS_CHALLAN_CREATE"];
8
+ const VENDOR_TDS_CHALLAN_UPDATE_PERMISSION = ["VENDOR_TDS_CHALLAN_UPDATE"];
9
+ const VENDOR_TDS_CHALLAN_DELETE_PERMISSION = ["VENDOR_TDS_CHALLAN_DELETE"];
10
+ const VENDOR_TDS_CHALLAN_DEACTIVATE_PERMISSION = ["VENDOR_TDS_CHALLAN_DEACTIVATE"];
11
+ const VENDOR_TDS_CHALLAN_ACTIVATE_PERMISSION = ["VENDOR_TDS_CHALLAN_ACTIVATE"];
12
+ const VENDOR_TDS_CHALLAN_RESTORE_PERMISSION = ["VENDOR_TDS_CHALLAN_RESTORE"];
13
+ const ACTION_MAP = {
14
+ [api_1.VendorTdsChallanActionEnum.CREATE]: {
15
+ reachableStatues: [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED],
16
+ permissions: VENDOR_TDS_CHALLAN_CREATE_PERMISSION,
17
+ },
18
+ [api_1.VendorTdsChallanActionEnum.UPDATE]: {
19
+ reachableStatues: [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED],
20
+ permissions: VENDOR_TDS_CHALLAN_UPDATE_PERMISSION,
21
+ },
22
+ [api_1.VendorTdsChallanActionEnum.DELETE]: {
23
+ reachableStatues: [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.DELETED],
24
+ permissions: VENDOR_TDS_CHALLAN_DELETE_PERMISSION,
25
+ },
26
+ [api_1.VendorTdsChallanActionEnum.DEACTIVATE]: {
27
+ reachableStatues: [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.DEACTIVATED],
28
+ permissions: VENDOR_TDS_CHALLAN_DEACTIVATE_PERMISSION,
29
+ },
30
+ [api_1.VendorTdsChallanActionEnum.ACTIVATE]: {
31
+ reachableStatues: [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED],
32
+ permissions: VENDOR_TDS_CHALLAN_ACTIVATE_PERMISSION,
33
+ },
34
+ [api_1.VendorTdsChallanActionEnum.RESTORE]: {
35
+ reachableStatues: [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED],
36
+ permissions: VENDOR_TDS_CHALLAN_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.VendorTdsChallanActionEnum.UPDATE, vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED);
42
+ const transitionApprovedStatusDeleteAction = createActionConfig(api_1.VendorTdsChallanActionEnum.DELETE, vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.DELETED);
43
+ const transitionApprovedStatusDeactivateAction = createActionConfig(api_1.VendorTdsChallanActionEnum.DEACTIVATE, vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.DEACTIVATED);
44
+ // DEACTIVATED status transitions
45
+ const transitionDeactivatedStatusDeleteAction = createActionConfig(api_1.VendorTdsChallanActionEnum.DELETE, vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.DELETED);
46
+ const transitionDeactivatedStatusActivateAction = createActionConfig(api_1.VendorTdsChallanActionEnum.ACTIVATE, vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED);
47
+ // DELETED status transitions
48
+ const transitionDeletedStatusUpdateAction = createActionConfig(api_1.VendorTdsChallanActionEnum.UPDATE, vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED);
49
+ const transitionDeletedStatusRestoreAction = createActionConfig(api_1.VendorTdsChallanActionEnum.RESTORE, vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED);
50
+ exports.vendorTdsChallanFlowConfig = {
51
+ [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED]: {
52
+ actions: {
53
+ [api_1.VendorTdsChallanActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
54
+ [api_1.VendorTdsChallanActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
55
+ [api_1.VendorTdsChallanActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
56
+ },
57
+ },
58
+ [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.DEACTIVATED]: {
59
+ actions: {
60
+ [api_1.VendorTdsChallanActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
61
+ [api_1.VendorTdsChallanActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
62
+ },
63
+ },
64
+ [vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.DELETED]: {
65
+ actions: {
66
+ [api_1.VendorTdsChallanActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
67
+ [api_1.VendorTdsChallanActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
68
+ },
69
+ },
70
+ };
@@ -235,3 +235,7 @@ export * from "./enums/vendor_tds_liability_status_enum";
235
235
  export * from "./interface/vendor_tds_liability.entity.interface";
236
236
  export * from "./model/vendor_tds_liability.entity.model";
237
237
  export * from "./flow-configs/vendor_tds_liability_flow.config";
238
+ export * from "./enums/vendor_tds_challan_status_enum";
239
+ export * from "./interface/vendor_tds_challan.entity.interface";
240
+ export * from "./model/vendor_tds_challan.entity.model";
241
+ export * from "./flow-configs/vendor_tds_challan_flow.config";
@@ -251,3 +251,7 @@ __exportStar(require("./enums/vendor_tds_liability_status_enum"), exports);
251
251
  __exportStar(require("./interface/vendor_tds_liability.entity.interface"), exports);
252
252
  __exportStar(require("./model/vendor_tds_liability.entity.model"), exports);
253
253
  __exportStar(require("./flow-configs/vendor_tds_liability_flow.config"), exports);
254
+ __exportStar(require("./enums/vendor_tds_challan_status_enum"), exports);
255
+ __exportStar(require("./interface/vendor_tds_challan.entity.interface"), exports);
256
+ __exportStar(require("./model/vendor_tds_challan.entity.model"), exports);
257
+ __exportStar(require("./flow-configs/vendor_tds_challan_flow.config"), exports);
@@ -69,6 +69,7 @@ import { VendorInvoiceHistoryEntityModel } from "../model/vendor_invoice_history
69
69
  import { VendorInvoiceItemEntityModel } from "../model/vendor_invoice_item.entity.model";
70
70
  import { VendorInvoiceItemHistoryEntityModel } from "../model/vendor_invoice_item_history.entity.model";
71
71
  import { VendorInvoicePaymentEntityModel } from "../model/vendor_invoice_payment.entity.model";
72
+ import { VendorTdsChallanEntityModel } from "../model/vendor_tds_challan.entity.model";
72
73
  import { VendorTdsLiabilityEntityModel } from "../model/vendor_tds_liability.entity.model";
73
74
  import { VoucherTypeEntityModel } from "../model/voucher_type.entity.model";
74
75
  import { WebsiteLeadEntityModel } from "../model/website_lead.entity.model";
@@ -137,6 +138,7 @@ import { IVendorEntity } from "./vendor.entity.interface";
137
138
  import { IVendorInvoiceEntity } from "./vendor_invoice.entity.interface";
138
139
  import { IVendorInvoiceItemEntity } from "./vendor_invoice_item.entity.interface";
139
140
  import { IVendorInvoicePaymentEntity } from "./vendor_invoice_payment.entity.interface";
141
+ import { IVendorTdsChallanEntity } from "./vendor_tds_challan.entity.interface";
140
142
  import { IVendorTdsLiabilityEntity } from "./vendor_tds_liability.entity.interface";
141
143
  import { IVendorInvoiceHistoryEntity } from "./vendot-invoice-history.entity.interface";
142
144
  import { IVoucherTypeEntity } from "./voucher_type.entity.interface";
@@ -252,7 +254,8 @@ export declare enum EntityEnum {
252
254
  ENTITY_HISTORY = "entity_history",
253
255
  VENDOR_INVOICE_PAYMENT = "vendor_invoice_payment",
254
256
  LEAVE_APPROVAL = "leave_approval",
255
- VENDOR_TDS_LIABILITY = "vendor_tds_liability"
257
+ VENDOR_TDS_LIABILITY = "vendor_tds_liability",
258
+ VENDOR_TDS_CHALLAN = "vendor_tds_challan"
256
259
  }
257
260
  export type EntityRelations = {
258
261
  [K in EntityEnum | VirtualEntityEnum]: K;
@@ -277,7 +280,7 @@ export type IBaseEntityApiResponse<T> = {
277
280
  [key in EntityEnum | VirtualEntityEnum]?: AggregationFields<EnumToModel<key>>[];
278
281
  };
279
282
  };
280
- 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 : never) & {
283
+ 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 : never) & {
281
284
  id: number;
282
285
  };
283
286
  export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
@@ -409,7 +412,7 @@ export declare enum VirtualEntityEnum {
409
412
  }
410
413
  export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
411
414
  export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
412
- 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 : UserEntityModel;
415
+ 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 : UserEntityModel;
413
416
  export type EntityMap = {
414
417
  [key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
415
418
  } & {
@@ -103,6 +103,7 @@ var EntityEnum;
103
103
  EntityEnum["VENDOR_INVOICE_PAYMENT"] = "vendor_invoice_payment";
104
104
  EntityEnum["LEAVE_APPROVAL"] = "leave_approval";
105
105
  EntityEnum["VENDOR_TDS_LIABILITY"] = "vendor_tds_liability";
106
+ EntityEnum["VENDOR_TDS_CHALLAN"] = "vendor_tds_challan";
106
107
  })(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
107
108
  var VirtualEntityEnum;
108
109
  (function (VirtualEntityEnum) {
@@ -0,0 +1,15 @@
1
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
+ import { Nullable } from "./entity.utils.interface";
3
+ import { VendorTdsChallanStatusEnum } from "../enums/vendor_tds_challan_status_enum";
4
+ export interface IVendorTdsChallanEntity extends IEntityAuditColumn {
5
+ id: number;
6
+ challanDate: number;
7
+ period: number;
8
+ tdsRateId: number;
9
+ challanNo: string;
10
+ bankId: number;
11
+ amount: number;
12
+ interest?: Nullable<number>;
13
+ remark?: Nullable<string>;
14
+ status: VendorTdsChallanStatusEnum;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -76,6 +76,7 @@ const vendor_invoice_history_entity_model_1 = require("./vendor_invoice_history.
76
76
  const vendor_invoice_item_entity_model_1 = require("./vendor_invoice_item.entity.model");
77
77
  const vendor_invoice_item_history_entity_model_1 = require("./vendor_invoice_item_history.entity.model");
78
78
  const vendor_invoice_payment_entity_model_1 = require("./vendor_invoice_payment.entity.model");
79
+ const vendor_tds_challan_entity_model_1 = require("./vendor_tds_challan.entity.model");
79
80
  const vendor_tds_liability_entity_model_1 = require("./vendor_tds_liability.entity.model");
80
81
  const voucher_type_entity_model_1 = require("./voucher_type.entity.model");
81
82
  const website_lead_entity_model_1 = require("./website_lead.entity.model");
@@ -182,6 +183,7 @@ exports.entityEnumToEntityModel = {
182
183
  [entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_PAYMENT]: vendor_invoice_payment_entity_model_1.VendorInvoicePaymentEntityModel.fromEntity,
183
184
  [entity_utils_interface_1.EntityEnum.LEAVE_APPROVAL]: leave_approval_entity_model_1.LeaveApprovalEntityModel.fromEntity,
184
185
  [entity_utils_interface_1.EntityEnum.VENDOR_TDS_LIABILITY]: vendor_tds_liability_entity_model_1.VendorTdsLiabilityEntityModel.fromEntity,
186
+ [entity_utils_interface_1.EntityEnum.VENDOR_TDS_CHALLAN]: vendor_tds_challan_entity_model_1.VendorTdsChallanEntityModel.fromEntity,
185
187
  };
186
188
  function entityMapToModels(entityMap) {
187
189
  for (const entityName in entityMap) {
@@ -1,6 +1,34 @@
1
1
  "use strict";
2
2
  // import { EntityEnum } from "../interface/entity.utils.interface";
3
3
  // import { BaseEntityModel } from "./base.entity.model";
4
+ // import { RelationConfigs } from "../interface/relation-config.interface";
5
+ // import { RelationType } from "../enums/relation-type.enum";
6
+ // import { IUserEntity } from "../interface/user.entity.interface";
7
+ // import { AppBadRequestException } from "../../exceptions";
8
+ // import { ErrorKeyEnum } from "../../enums/error.key.enum";
9
+ // import { UserEntityModel } from "./user.entity.model";
10
+ // import { IRowActions } from "./interface/row-actions.interface";
11
+ // import { EntityActionFlowResolverV2 } from "../../utils";
12
+ // import { ITdsRateEntity } from "../interface/tds_rate.entity.interface";
13
+ // import { TdsRateStatusEnum } from "../enums/tds_rate_status_enum";
14
+ // import { OrganizationTypeTdsRateMappingEntityModel } from "./organization_type_tds_rate_mapping.entity.model";
15
+ // import { TdsRateVoucherTypeMappingEntityModel } from "./tds_rate_voucher_type_mapping.entity.model";
16
+ // import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
17
+ // import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
18
+ // import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
19
+ // import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
20
+ // import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
21
+ // import { VendorEntityModel } from "./vendor.entity.model";
22
+ // import { StateEntityModel } from "./state.entity.model";
23
+ // import { CountryEntityModel } from "./country.entity.model";
24
+ // import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
25
+ // import { OfficeLocationEntityModel } from "./office_location.entity.model";
26
+ // import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
27
+ // import { GstRateEntityModel } from "./gst_rate.entity.model";
28
+ // import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
29
+ // import { BankEntityModel } from "./bank.entity.model";
30
+ // import { TdsRateActionEnum } from "../../api";
31
+ // import { ITdsRateFlowConfigContextData, tdsRateFlowConfig } from "../flow-configs/tds_rate_flow.config";
4
32
  // export class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_RATE> implements ITdsRateEntity {
5
33
  // id: number = 0;
6
34
  // section: string = "";
@@ -15,7 +43,20 @@
15
43
  // createdBy: number = 0;
16
44
  // updatedBy: number = 0;
17
45
  // organizationTypeTdsRateMappings?: OrganizationTypeTdsRateMappingEntityModel[];
18
- // static relationConfigs: RelationConfigs<[EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING], EnumEntityType<EntityEnum.TDS_RATE>> = [
46
+ // tdsRateVoucherTypeMappings?: TdsRateVoucherTypeMappingEntityModel[];
47
+ // vendorInvoiceItems?: VendorInvoiceItemEntityModel[];
48
+ // vendorTdsLiabilitys?: VendorTdsLiabilityEntityModel[];
49
+ // vendorTdsChallans?: VendorTdsChallanEntityModel[];
50
+ // static relationConfigs: RelationConfigs<
51
+ // [
52
+ // EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
53
+ // EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING,
54
+ // EntityEnum.VENDOR_INVOICE_ITEM,
55
+ // EntityEnum.VENDOR_TDS_LIABILITY,
56
+ // EntityEnum.VENDOR_TDS_CHALLAN,
57
+ // ],
58
+ // EntityEnum.TDS_RATE
59
+ // > = [
19
60
  // {
20
61
  // name: EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
21
62
  // relation: RelationType.MANY,
@@ -25,6 +66,42 @@
25
66
  // key: "id",
26
67
  // },
27
68
  // },
69
+ // {
70
+ // name: EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING,
71
+ // relation: RelationType.MANY,
72
+ // key: "tdsRateVoucherTypeMappings",
73
+ // mapKeyConfig: {
74
+ // relationKey: "tdsRateId",
75
+ // key: "id",
76
+ // },
77
+ // },
78
+ // {
79
+ // name: EntityEnum.VENDOR_INVOICE_ITEM,
80
+ // relation: RelationType.MANY,
81
+ // key: "vendorInvoiceItems",
82
+ // mapKeyConfig: {
83
+ // relationKey: "tdsRateId",
84
+ // key: "id",
85
+ // },
86
+ // },
87
+ // {
88
+ // name: EntityEnum.VENDOR_TDS_LIABILITY,
89
+ // relation: RelationType.MANY,
90
+ // key: "vendorTdsLiabilitys",
91
+ // mapKeyConfig: {
92
+ // relationKey: "tdsRateId",
93
+ // key: "id",
94
+ // },
95
+ // },
96
+ // {
97
+ // name: EntityEnum.VENDOR_TDS_CHALLAN,
98
+ // relation: RelationType.MANY,
99
+ // key: "vendorTdsChallans",
100
+ // mapKeyConfig: {
101
+ // relationKey: "tdsRateId",
102
+ // key: "id",
103
+ // },
104
+ // },
28
105
  // ];
29
106
  // static fromEntity(entity: ITdsRateEntity): TdsRateEntityModel {
30
107
  // const result = new TdsRateEntityModel(EntityEnum.TDS_RATE);
@@ -34,4 +111,151 @@
34
111
  // getRelationConfigs(): any[] {
35
112
  // return this.constructor.prototype.constructor.relationConfigs || [];
36
113
  // }
114
+ // get organizationTypes(): OrganizationTypeEntityModel[] {
115
+ // if (this.organizationTypeTdsRateMappings) {
116
+ // return this.organizationTypeTdsRateMappings.filter((mapping) => mapping.organizationType).map((mapping) => mapping.organizationType!);
117
+ // }
118
+ // return [];
119
+ // }
120
+ // get voucherTypes(): VoucherTypeEntityModel[] {
121
+ // if (this.tdsRateVoucherTypeMappings) {
122
+ // return this.tdsRateVoucherTypeMappings.filter((mapping) => mapping.voucherType).map((mapping) => mapping.voucherType!);
123
+ // }
124
+ // return [];
125
+ // }
126
+ // get vendors(): VendorEntityModel[] | undefined {
127
+ // // many_to_many -> many_to_many verified
128
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many'}
129
+ // // ['tds_rate', 'organization_type'] -> many_to_many
130
+ // // ['organization_type', 'vendor'] -> one_to_many
131
+ // return this.organizationTypes
132
+ // ?.flatMap((organizationType) => organizationType.vendors)
133
+ // .filter((vendor): vendor is VendorEntityModel => !!vendor)
134
+ // .reduce((accumulator: VendorEntityModel[], current) => {
135
+ // if (!accumulator.some((vendor) => vendor.id === current.id)) {
136
+ // accumulator.push(current);
137
+ // }
138
+ // return accumulator;
139
+ // }, []);
140
+ // }
141
+ // get states(): StateEntityModel[] | undefined {
142
+ // // many_to_many -> many_to_many verified
143
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->state': 'many_to_one'}
144
+ // // ['organization_type', 'vendor'] -> one_to_many
145
+ // // ['vendor', 'state'] -> many_to_one
146
+ // return this.vendors
147
+ // ?.flatMap((vendor) => vendor.state)
148
+ // .filter((state): state is StateEntityModel => !!state)
149
+ // .reduce((accumulator: StateEntityModel[], current) => {
150
+ // if (!accumulator.some((state) => state.id === current.id)) {
151
+ // accumulator.push(current);
152
+ // }
153
+ // return accumulator;
154
+ // }, []);
155
+ // }
156
+ // get countrys(): CountryEntityModel[] | undefined {
157
+ // // many_to_many -> many_to_many verified
158
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->country': 'many_to_one'}
159
+ // // ['organization_type', 'vendor'] -> one_to_many
160
+ // // ['vendor', 'country'] -> many_to_one
161
+ // return this.vendors
162
+ // ?.flatMap((vendor) => vendor.country)
163
+ // .filter((country): country is CountryEntityModel => !!country)
164
+ // .reduce((accumulator: CountryEntityModel[], current) => {
165
+ // if (!accumulator.some((country) => country.id === current.id)) {
166
+ // accumulator.push(current);
167
+ // }
168
+ // return accumulator;
169
+ // }, []);
170
+ // }
171
+ // get vendorInvoices(): VendorInvoiceEntityModel[] | undefined {
172
+ // // one_to_many -> many_to_many mismatch
173
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many'}
174
+ // // ['organization_type', 'vendor'] -> one_to_many
175
+ // // ['vendor', 'vendor_invoice'] -> one_to_many
176
+ // return this.vendors
177
+ // ?.flatMap((vendor) => vendor.vendorInvoices)
178
+ // .filter((vendorInvoice): vendorInvoice is VendorInvoiceEntityModel => !!vendorInvoice)
179
+ // .reduce((accumulator: VendorInvoiceEntityModel[], current) => {
180
+ // if (!accumulator.some((vendorInvoice) => vendorInvoice.id === current.id)) {
181
+ // accumulator.push(current);
182
+ // }
183
+ // return accumulator;
184
+ // }, []);
185
+ // }
186
+ // get officeLocations(): OfficeLocationEntityModel[] | undefined {
187
+ // // many_to_many -> many_to_many verified
188
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->office_location': 'many_to_one'}
189
+ // // ['vendor', 'vendor_invoice'] -> one_to_many
190
+ // // ['vendor_invoice', 'office_location'] -> many_to_one
191
+ // return this.vendorInvoices
192
+ // ?.flatMap((vendorInvoice) => vendorInvoice.officeLocation)
193
+ // .filter((officeLocation): officeLocation is OfficeLocationEntityModel => !!officeLocation)
194
+ // .reduce((accumulator: OfficeLocationEntityModel[], current) => {
195
+ // if (!accumulator.some((officeLocation) => officeLocation.id === current.id)) {
196
+ // accumulator.push(current);
197
+ // }
198
+ // return accumulator;
199
+ // }, []);
200
+ // }
201
+ // get expenseHeads(): ExpenseHeadEntityModel[] | undefined {
202
+ // // many_to_many -> many_to_many verified
203
+ // // {'tds_rate->voucher_type': 'many_to_many', 'voucher_type->expense_head': 'one_to_many'}
204
+ // // ['tds_rate', 'voucher_type'] -> many_to_many
205
+ // // ['voucher_type', 'expense_head'] -> one_to_many
206
+ // return this.voucherTypes
207
+ // ?.flatMap((voucherType) => voucherType.expenseHeads)
208
+ // .filter((expenseHead): expenseHead is ExpenseHeadEntityModel => !!expenseHead)
209
+ // .reduce((accumulator: ExpenseHeadEntityModel[], current) => {
210
+ // if (!accumulator.some((expenseHead) => expenseHead.id === current.id)) {
211
+ // accumulator.push(current);
212
+ // }
213
+ // return accumulator;
214
+ // }, []);
215
+ // }
216
+ // get gstRates(): GstRateEntityModel[] | undefined {
217
+ // // many_to_many -> many_to_many verified
218
+ // // {'tds_rate->vendor_invoice_item': 'one_to_many', 'vendor_invoice_item->gst_rate': 'many_to_one'}
219
+ // // ['tds_rate', 'vendor_invoice_item'] -> one_to_many
220
+ // // ['vendor_invoice_item', 'gst_rate'] -> many_to_one
221
+ // return this.vendorInvoiceItems
222
+ // ?.flatMap((vendorInvoiceItem) => vendorInvoiceItem.gstRate)
223
+ // .filter((gstRate): gstRate is GstRateEntityModel => !!gstRate)
224
+ // .reduce((accumulator: GstRateEntityModel[], current) => {
225
+ // if (!accumulator.some((gstRate) => gstRate.id === current.id)) {
226
+ // accumulator.push(current);
227
+ // }
228
+ // return accumulator;
229
+ // }, []);
230
+ // }
231
+ // get vendorInvoicePayments(): VendorInvoicePaymentEntityModel[] | undefined {
232
+ // // one_to_many -> many_to_many mismatch
233
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->vendor_invoice_payment': 'one_to_many'}
234
+ // // ['vendor', 'vendor_invoice'] -> one_to_many
235
+ // // ['vendor_invoice', 'vendor_invoice_payment'] -> one_to_many
236
+ // return this.vendorInvoices
237
+ // ?.flatMap((vendorInvoice) => vendorInvoice.vendorInvoicePayments)
238
+ // .filter((vendorInvoicePayment): vendorInvoicePayment is VendorInvoicePaymentEntityModel => !!vendorInvoicePayment)
239
+ // .reduce((accumulator: VendorInvoicePaymentEntityModel[], current) => {
240
+ // if (!accumulator.some((vendorInvoicePayment) => vendorInvoicePayment.id === current.id)) {
241
+ // accumulator.push(current);
242
+ // }
243
+ // return accumulator;
244
+ // }, []);
245
+ // }
246
+ // get banks(): BankEntityModel[] | undefined {
247
+ // // many_to_many -> many_to_many verified
248
+ // // {'tds_rate->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->bank': 'many_to_one'}
249
+ // // ['tds_rate', 'vendor_tds_challan'] -> one_to_many
250
+ // // ['vendor_tds_challan', 'bank'] -> many_to_one
251
+ // return this.vendorTdsChallans
252
+ // ?.flatMap((vendorTdsChallan) => vendorTdsChallan.bank)
253
+ // .filter((bank): bank is BankEntityModel => !!bank)
254
+ // .reduce((accumulator: BankEntityModel[], current) => {
255
+ // if (!accumulator.some((bank) => bank.id === current.id)) {
256
+ // accumulator.push(current);
257
+ // }
258
+ // return accumulator;
259
+ // }, []);
260
+ // }
37
261
  // }
@@ -15,6 +15,8 @@ import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
15
15
  import { OfficeLocationEntityModel } from "./office_location.entity.model";
16
16
  import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
17
17
  import { GstRateEntityModel } from "./gst_rate.entity.model";
18
+ import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
19
+ import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
18
20
  export declare class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_RATE> implements ITdsRateEntity {
19
21
  id: number;
20
22
  section: string;
@@ -31,10 +33,14 @@ export declare class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_R
31
33
  organizationTypeTdsRateMappings?: OrganizationTypeTdsRateMappingEntityModel[];
32
34
  tdsRateVoucherTypeMappings?: TdsRateVoucherTypeMappingEntityModel[];
33
35
  vendorInvoiceItems?: VendorInvoiceItemEntityModel[];
36
+ vendorTdsLiabilitys?: VendorTdsLiabilityEntityModel[];
37
+ vendorTdsChallans?: VendorTdsChallanEntityModel[];
34
38
  static relationConfigs: RelationConfigs<[
35
39
  EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
36
40
  EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING,
37
- EntityEnum.VENDOR_INVOICE_ITEM
41
+ EntityEnum.VENDOR_INVOICE_ITEM,
42
+ EntityEnum.VENDOR_TDS_LIABILITY,
43
+ EntityEnum.VENDOR_TDS_CHALLAN
38
44
  ], EntityEnum.TDS_RATE>;
39
45
  static fromEntity(entity: ITdsRateEntity): TdsRateEntityModel;
40
46
  getRelationConfigs(): any[];
@@ -171,4 +171,22 @@ TdsRateEntityModel.relationConfigs = [
171
171
  key: "id",
172
172
  },
173
173
  },
174
+ {
175
+ name: entity_utils_interface_1.EntityEnum.VENDOR_TDS_LIABILITY,
176
+ relation: relation_type_enum_1.RelationType.MANY,
177
+ key: "vendorTdsLiabilitys",
178
+ mapKeyConfig: {
179
+ relationKey: "tdsRateId",
180
+ key: "id",
181
+ },
182
+ },
183
+ {
184
+ name: entity_utils_interface_1.EntityEnum.VENDOR_TDS_CHALLAN,
185
+ relation: relation_type_enum_1.RelationType.MANY,
186
+ key: "vendorTdsChallans",
187
+ mapKeyConfig: {
188
+ relationKey: "tdsRateId",
189
+ key: "id",
190
+ },
191
+ },
174
192
  ];
@@ -12,6 +12,7 @@ import { OfficeLocationEntityModel } from "./office_location.entity.model";
12
12
  import { UserEntityModel } from "./user.entity.model";
13
13
  import { VendorEntityModel } from "./vendor.entity.model";
14
14
  import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
15
+ import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
15
16
  export declare class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum.VENDOR_INVOICE> implements IVendorInvoiceEntity {
16
17
  id: number;
17
18
  vendorId: number;
@@ -39,7 +40,13 @@ export declare class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum
39
40
  vendor?: VendorEntityModel;
40
41
  officeLocation?: OfficeLocationEntityModel;
41
42
  vendorInvoiceItems?: VendorInvoiceItemEntityModel[];
42
- static relationConfigs: RelationConfigs<[EntityEnum.VENDOR, EntityEnum.OFFICE_LOCATION, EntityEnum.VENDOR_INVOICE_ITEM], EntityEnum.VENDOR_INVOICE>;
43
+ vendorInvoicePayments?: VendorInvoicePaymentEntityModel[];
44
+ static relationConfigs: RelationConfigs<[
45
+ EntityEnum.VENDOR,
46
+ EntityEnum.OFFICE_LOCATION,
47
+ EntityEnum.VENDOR_INVOICE_ITEM,
48
+ EntityEnum.VENDOR_INVOICE_PAYMENT
49
+ ], EntityEnum.VENDOR_INVOICE>;
43
50
  static fromEntity(entity: IVendorInvoiceEntity): VendorInvoiceEntityModel;
44
51
  getRelationConfigs(): any[];
45
52
  getAvailableActions(currentUser: UserEntityModel, config?: {
@@ -272,4 +272,13 @@ VendorInvoiceEntityModel.relationConfigs = [
272
272
  key: "id",
273
273
  },
274
274
  },
275
+ {
276
+ name: entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_PAYMENT,
277
+ relation: relation_type_enum_1.RelationType.MANY,
278
+ key: "vendorInvoicePayments",
279
+ mapKeyConfig: {
280
+ relationKey: "vendorInvoiceId",
281
+ key: "id",
282
+ },
283
+ },
275
284
  ];
@@ -0,0 +1,68 @@
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 { IVendorTdsChallanEntity } from "../interface/vendor_tds_challan.entity.interface";
8
+ import { VendorTdsChallanStatusEnum } from "../enums/vendor_tds_challan_status_enum";
9
+ import { BankEntityModel } from "./bank.entity.model";
10
+ import { TdsRateEntityModel } from "./tds_rate.entity.model";
11
+ import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
12
+ import { VendorEntityModel } from "./vendor.entity.model";
13
+ import { StateEntityModel } from "./state.entity.model";
14
+ import { CountryEntityModel } from "./country.entity.model";
15
+ import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
16
+ import { OfficeLocationEntityModel } from "./office_location.entity.model";
17
+ import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
18
+ import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
19
+ import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
20
+ import { GstRateEntityModel } from "./gst_rate.entity.model";
21
+ import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
22
+ import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
23
+ import { VendorTdsChallanActionEnum } from "../../api";
24
+ import { IVendorTdsChallanFlowConfigContextData } from "../flow-configs/vendor_tds_challan_flow.config";
25
+ export declare class VendorTdsChallanEntityModel extends BaseEntityModel<EntityEnum.VENDOR_TDS_CHALLAN> implements IVendorTdsChallanEntity {
26
+ id: number;
27
+ challanDate: number;
28
+ period: number;
29
+ tdsRateId: number;
30
+ challanNo: string;
31
+ bankId: number;
32
+ amount: number;
33
+ interest?: number;
34
+ remark?: string;
35
+ status: VendorTdsChallanStatusEnum;
36
+ createdOn: number;
37
+ updatedOn: number;
38
+ createdBy: number;
39
+ updatedBy: number;
40
+ bank?: BankEntityModel;
41
+ tdsRate?: TdsRateEntityModel;
42
+ static relationConfigs: RelationConfigs<[EntityEnum.BANK, EntityEnum.TDS_RATE], EntityEnum.VENDOR_TDS_CHALLAN>;
43
+ static fromEntity(entity: IVendorTdsChallanEntity): VendorTdsChallanEntityModel;
44
+ getRelationConfigs(): any[];
45
+ get organizationTypes(): OrganizationTypeEntityModel[] | undefined;
46
+ get vendors(): VendorEntityModel[] | undefined;
47
+ get states(): StateEntityModel[] | undefined;
48
+ get countrys(): CountryEntityModel[] | undefined;
49
+ get vendorInvoices(): VendorInvoiceEntityModel[] | undefined;
50
+ get officeLocations(): OfficeLocationEntityModel[] | undefined;
51
+ get vendorInvoiceItems(): VendorInvoiceItemEntityModel[] | undefined;
52
+ get voucherTypes(): VoucherTypeEntityModel[] | undefined;
53
+ get expenseHeads(): ExpenseHeadEntityModel[] | undefined;
54
+ get gstRates(): GstRateEntityModel[] | undefined;
55
+ get vendorInvoicePayments(): VendorInvoicePaymentEntityModel[] | undefined;
56
+ get vendorTdsLiabilitys(): VendorTdsLiabilityEntityModel[] | undefined;
57
+ getNextStatus(currentUser: IUserEntity, action: VendorTdsChallanActionEnum, vendorTdsChallanFlowConfigContextData: IVendorTdsChallanFlowConfigContextData): VendorTdsChallanStatusEnum;
58
+ getAvailableActions(currentUser: UserEntityModel, config?: {
59
+ combinedActions?: Record<string, {
60
+ combineActions: VendorTdsChallanActionEnum[];
61
+ label: string;
62
+ }>;
63
+ customLabels?: Partial<Record<VendorTdsChallanActionEnum, string>>;
64
+ }): IRowActions<EntityEnum.VENDOR_TDS_CHALLAN>[];
65
+ getUpdateActionVisibility(currentUser: UserEntityModel): {
66
+ [key: string]: () => boolean;
67
+ };
68
+ }
@@ -0,0 +1,251 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VendorTdsChallanEntityModel = 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_tds_challan_status_enum_1 = require("../enums/vendor_tds_challan_status_enum");
11
+ const vendor_tds_challan_flow_config_1 = require("../flow-configs/vendor_tds_challan_flow.config");
12
+ class VendorTdsChallanEntityModel extends base_entity_model_1.BaseEntityModel {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.id = 0;
16
+ this.challanDate = 0;
17
+ this.period = 0;
18
+ this.tdsRateId = 0;
19
+ this.challanNo = "";
20
+ this.bankId = 0;
21
+ this.amount = 0;
22
+ this.status = vendor_tds_challan_status_enum_1.VendorTdsChallanStatusEnum.APPROVED;
23
+ this.createdOn = 0;
24
+ this.updatedOn = 0;
25
+ this.createdBy = 0;
26
+ this.updatedBy = 0;
27
+ }
28
+ static fromEntity(entity) {
29
+ const result = new VendorTdsChallanEntityModel(entity_utils_interface_1.EntityEnum.VENDOR_TDS_CHALLAN);
30
+ Object.assign(result, entity);
31
+ return result;
32
+ }
33
+ getRelationConfigs() {
34
+ return this.constructor.prototype.constructor.relationConfigs || [];
35
+ }
36
+ get organizationTypes() {
37
+ // many_to_many -> many_to_many verified
38
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many'}
39
+ // ['vendor_tds_challan', 'tds_rate'] -> many_to_one
40
+ // ['tds_rate', 'organization_type'] -> many_to_many
41
+ var _a;
42
+ return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.organizationTypes;
43
+ }
44
+ get vendors() {
45
+ // many_to_many -> many_to_many verified
46
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many'}
47
+ // ['tds_rate', 'organization_type'] -> many_to_many
48
+ // ['organization_type', 'vendor'] -> one_to_many
49
+ var _a;
50
+ return (_a = this.organizationTypes) === null || _a === void 0 ? void 0 : _a.flatMap((organizationType) => organizationType.vendors).filter((vendor) => !!vendor).reduce((accumulator, current) => {
51
+ if (!accumulator.some((vendor) => vendor.id === current.id)) {
52
+ accumulator.push(current);
53
+ }
54
+ return accumulator;
55
+ }, []);
56
+ }
57
+ get states() {
58
+ // many_to_many -> many_to_many verified
59
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->state': 'many_to_one'}
60
+ // ['organization_type', 'vendor'] -> one_to_many
61
+ // ['vendor', 'state'] -> many_to_one
62
+ var _a;
63
+ return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.stateModel).filter((state) => !!state).reduce((accumulator, current) => {
64
+ if (!accumulator.some((state) => state.id === current.id)) {
65
+ accumulator.push(current);
66
+ }
67
+ return accumulator;
68
+ }, []);
69
+ }
70
+ get countrys() {
71
+ // many_to_many -> many_to_many verified
72
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->country': 'many_to_one'}
73
+ // ['organization_type', 'vendor'] -> one_to_many
74
+ // ['vendor', 'country'] -> many_to_one
75
+ var _a;
76
+ return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.countryModel).filter((country) => !!country).reduce((accumulator, current) => {
77
+ if (!accumulator.some((country) => country.id === current.id)) {
78
+ accumulator.push(current);
79
+ }
80
+ return accumulator;
81
+ }, []);
82
+ }
83
+ get vendorInvoices() {
84
+ // one_to_many -> many_to_many mismatch
85
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many'}
86
+ // ['organization_type', 'vendor'] -> one_to_many
87
+ // ['vendor', 'vendor_invoice'] -> one_to_many
88
+ var _a;
89
+ return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.vendorInvoices).filter((vendorInvoice) => !!vendorInvoice).reduce((accumulator, current) => {
90
+ if (!accumulator.some((vendorInvoice) => vendorInvoice.id === current.id)) {
91
+ accumulator.push(current);
92
+ }
93
+ return accumulator;
94
+ }, []);
95
+ }
96
+ get officeLocations() {
97
+ // many_to_many -> many_to_many verified
98
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->office_location': 'many_to_one'}
99
+ // ['vendor', 'vendor_invoice'] -> one_to_many
100
+ // ['vendor_invoice', 'office_location'] -> many_to_one
101
+ var _a;
102
+ return (_a = this.vendorInvoices) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoice) => vendorInvoice.officeLocation).filter((officeLocation) => !!officeLocation).reduce((accumulator, current) => {
103
+ if (!accumulator.some((officeLocation) => officeLocation.id === current.id)) {
104
+ accumulator.push(current);
105
+ }
106
+ return accumulator;
107
+ }, []);
108
+ }
109
+ get vendorInvoiceItems() {
110
+ // many_to_many -> many_to_many verified
111
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->vendor_invoice_item': 'one_to_many'}
112
+ // ['vendor_tds_challan', 'tds_rate'] -> many_to_one
113
+ // ['tds_rate', 'vendor_invoice_item'] -> one_to_many
114
+ var _a;
115
+ return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.vendorInvoiceItems;
116
+ }
117
+ get voucherTypes() {
118
+ // many_to_many -> many_to_many verified
119
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->voucher_type': 'many_to_many'}
120
+ // ['vendor_tds_challan', 'tds_rate'] -> many_to_one
121
+ // ['tds_rate', 'voucher_type'] -> many_to_many
122
+ var _a;
123
+ return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.voucherTypes;
124
+ }
125
+ get expenseHeads() {
126
+ // many_to_many -> many_to_many verified
127
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->voucher_type': 'many_to_many', 'voucher_type->expense_head': 'one_to_many'}
128
+ // ['tds_rate', 'voucher_type'] -> many_to_many
129
+ // ['voucher_type', 'expense_head'] -> one_to_many
130
+ var _a;
131
+ return (_a = this.voucherTypes) === null || _a === void 0 ? void 0 : _a.flatMap((voucherType) => voucherType.expenseHeads).filter((expenseHead) => !!expenseHead).reduce((accumulator, current) => {
132
+ if (!accumulator.some((expenseHead) => expenseHead.id === current.id)) {
133
+ accumulator.push(current);
134
+ }
135
+ return accumulator;
136
+ }, []);
137
+ }
138
+ get gstRates() {
139
+ // many_to_many -> many_to_many verified
140
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->vendor_invoice_item': 'one_to_many', 'vendor_invoice_item->gst_rate': 'many_to_one'}
141
+ // ['tds_rate', 'vendor_invoice_item'] -> one_to_many
142
+ // ['vendor_invoice_item', 'gst_rate'] -> many_to_one
143
+ var _a;
144
+ return (_a = this.vendorInvoiceItems) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoiceItem) => vendorInvoiceItem.gstRate).filter((gstRate) => !!gstRate).reduce((accumulator, current) => {
145
+ if (!accumulator.some((gstRate) => gstRate.id === current.id)) {
146
+ accumulator.push(current);
147
+ }
148
+ return accumulator;
149
+ }, []);
150
+ }
151
+ get vendorInvoicePayments() {
152
+ // one_to_many -> many_to_many mismatch
153
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->vendor_invoice_payment': 'one_to_many'}
154
+ // ['vendor', 'vendor_invoice'] -> one_to_many
155
+ // ['vendor_invoice', 'vendor_invoice_payment'] -> one_to_many
156
+ var _a;
157
+ return (_a = this.vendorInvoices) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoice) => vendorInvoice.vendorInvoicePayments).filter((vendorInvoicePayment) => !!vendorInvoicePayment).reduce((accumulator, current) => {
158
+ if (!accumulator.some((vendorInvoicePayment) => vendorInvoicePayment.id === current.id)) {
159
+ accumulator.push(current);
160
+ }
161
+ return accumulator;
162
+ }, []);
163
+ }
164
+ get vendorTdsLiabilitys() {
165
+ // many_to_many -> many_to_many verified
166
+ // {'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_liability': 'one_to_many'}
167
+ // ['vendor_tds_challan', 'tds_rate'] -> many_to_one
168
+ // ['tds_rate', 'vendor_tds_liability'] -> one_to_many
169
+ var _a;
170
+ return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.vendorTdsLiabilitys;
171
+ }
172
+ getNextStatus(currentUser, action, vendorTdsChallanFlowConfigContextData) {
173
+ if (!this.status) {
174
+ throw new exceptions_1.AppBadRequestException({
175
+ key: error_key_enum_1.ErrorKeyEnum.STATUS,
176
+ message: [`Status not found: ${this.status}`],
177
+ });
178
+ }
179
+ const flowForStatus = vendor_tds_challan_flow_config_1.vendorTdsChallanFlowConfig[this.status];
180
+ if (!flowForStatus) {
181
+ throw new exceptions_1.AppBadRequestException({
182
+ key: error_key_enum_1.ErrorKeyEnum.STATUS,
183
+ message: [`No flow configuration found for status: ${this.status}`],
184
+ });
185
+ }
186
+ if (!action) {
187
+ throw new exceptions_1.AppBadRequestException({
188
+ key: error_key_enum_1.ErrorKeyEnum.ACTION_DATA,
189
+ message: ["actionData is required"],
190
+ });
191
+ }
192
+ const matchingPermissionConfig = flowForStatus.actions[action];
193
+ if (!matchingPermissionConfig) {
194
+ throw new exceptions_1.AppBadRequestException({
195
+ key: error_key_enum_1.ErrorKeyEnum.ACTION,
196
+ message: [`Action '${action}' is not valid for the current status.`],
197
+ });
198
+ }
199
+ if (!currentUser.permissions || currentUser.permissions.length === 0) {
200
+ throw new exceptions_1.AppBadRequestException({
201
+ key: error_key_enum_1.ErrorKeyEnum.PERMISSIONS,
202
+ message: ["Permission not available for currentUser"],
203
+ });
204
+ }
205
+ const hasPermission = matchingPermissionConfig.permissions.some((permission) => currentUser.permissions.includes(permission));
206
+ if (!hasPermission) {
207
+ throw new exceptions_1.AppBadRequestException({
208
+ key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
209
+ message: [`Current user does not have permission to ${action} vendorTdsChallan`],
210
+ });
211
+ }
212
+ const nextStatus = matchingPermissionConfig.next(vendorTdsChallanFlowConfigContextData);
213
+ return nextStatus;
214
+ }
215
+ getAvailableActions(currentUser, config) {
216
+ var _a;
217
+ const params = {
218
+ flowConfig: vendor_tds_challan_flow_config_1.vendorTdsChallanFlowConfig,
219
+ currentStatus: this.status,
220
+ userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
221
+ visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
222
+ combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
223
+ customLabels: config === null || config === void 0 ? void 0 : config.customLabels,
224
+ };
225
+ return utils_1.EntityActionFlowResolverV2.getAvailableActionsData(params);
226
+ }
227
+ getUpdateActionVisibility(currentUser) {
228
+ return {};
229
+ }
230
+ }
231
+ exports.VendorTdsChallanEntityModel = VendorTdsChallanEntityModel;
232
+ VendorTdsChallanEntityModel.relationConfigs = [
233
+ {
234
+ name: entity_utils_interface_1.EntityEnum.BANK,
235
+ relation: relation_type_enum_1.RelationType.ONE,
236
+ key: "bank",
237
+ mapKeyConfig: {
238
+ relationKey: "id",
239
+ key: "bankId",
240
+ },
241
+ },
242
+ {
243
+ name: entity_utils_interface_1.EntityEnum.TDS_RATE,
244
+ relation: relation_type_enum_1.RelationType.ONE,
245
+ key: "tdsRate",
246
+ mapKeyConfig: {
247
+ relationKey: "id",
248
+ key: "tdsRateId",
249
+ },
250
+ },
251
+ ];
@@ -55,6 +55,7 @@ export declare class VendorTdsLiabilityEntityModel extends BaseEntityModel<Entit
55
55
  getUpdateActionVisibility(currentUser: UserEntityModel): {
56
56
  [key: string]: () => boolean;
57
57
  };
58
+ formatPeriod(formatStr: string): string;
58
59
  static derivePeriodFromDateCode({ dateCode }: {
59
60
  dateCode: number;
60
61
  }): number;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VendorTdsLiabilityEntityModel = void 0;
4
+ const date_fns_1 = require("date-fns");
4
5
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
5
6
  const base_entity_model_1 = require("./base.entity.model");
6
7
  const relation_type_enum_1 = require("../enums/relation-type.enum");
@@ -187,6 +188,11 @@ class VendorTdsLiabilityEntityModel extends base_entity_model_1.BaseEntityModel
187
188
  getUpdateActionVisibility(currentUser) {
188
189
  return {};
189
190
  }
191
+ formatPeriod(formatStr) {
192
+ const year = Math.floor(this.period / 100);
193
+ const month = this.period % 100;
194
+ return (0, date_fns_1.format)(new Date(year, month - 1), formatStr);
195
+ }
190
196
  static derivePeriodFromDateCode({ dateCode }) {
191
197
  return parseInt(dateCode.toString().slice(0, 6));
192
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "11.3.10-beta.0",
3
+ "version": "11.3.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [