law-common 10.68.2 → 10.68.3
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 +0 -2
- package/dist/src/api/index.js +0 -2
- package/dist/src/entities/flow-configs/billing-transaction.flow.config.d.ts +2 -0
- package/dist/src/entities/flow-configs/billing-transaction.flow.config.js +66 -0
- package/dist/src/entities/index.d.ts +1 -2
- package/dist/src/entities/index.js +1 -2
- package/dist/src/entities/interface/entity.utils.interface.d.ts +2 -5
- package/dist/src/entities/interface/entity.utils.interface.js +0 -1
- package/dist/src/entities/model/entity.model.interface.js +0 -2
- package/dist/src/entities/model/vendor.entity.model.d.ts +4 -2
- package/dist/src/entities/model/vendor.entity.model.js +6 -6
- package/package.json +1 -1
- package/dist/src/api/interface/billing.payment.create.dto.interface.d.ts +0 -3
- package/dist/src/api/interface/billing.payment.create.dto.interface.js +0 -2
- package/dist/src/api/interface/billing.payment.update.dto.interface.d.ts +0 -3
- package/dist/src/api/interface/billing.payment.update.dto.interface.js +0 -2
- package/dist/src/entities/enums/billing.payment.type.enum.d.ts +0 -4
- package/dist/src/entities/enums/billing.payment.type.enum.js +0 -8
- package/dist/src/entities/interface/billing_payment.entity.interface.d.ts +0 -15
- package/dist/src/entities/interface/billing_payment.entity.interface.js +0 -2
- package/dist/src/entities/model/billing_payment.entity.model.d.ts +0 -27
- package/dist/src/entities/model/billing_payment.entity.model.js +0 -48
package/dist/src/api/index.d.ts
CHANGED
|
@@ -24,8 +24,6 @@ export * from "./interface/billing.update.dto.interface";
|
|
|
24
24
|
export * from "./interface/bank.create.dto.interface";
|
|
25
25
|
export * from "./interface/bank.entity.response";
|
|
26
26
|
export * from "./interface/bank.update.dto.interface";
|
|
27
|
-
export * from "./interface/billing.payment.create.dto.interface";
|
|
28
|
-
export * from "./interface/billing.payment.update.dto.interface";
|
|
29
27
|
export * from "./interface/client.affiliate.create.dto.interface";
|
|
30
28
|
export * from "./interface/client.affiliate.update.dto.interface";
|
|
31
29
|
export * from "./interface/role.create.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -40,8 +40,6 @@ __exportStar(require("./interface/billing.update.dto.interface"), exports);
|
|
|
40
40
|
__exportStar(require("./interface/bank.create.dto.interface"), exports);
|
|
41
41
|
__exportStar(require("./interface/bank.entity.response"), exports);
|
|
42
42
|
__exportStar(require("./interface/bank.update.dto.interface"), exports);
|
|
43
|
-
__exportStar(require("./interface/billing.payment.create.dto.interface"), exports);
|
|
44
|
-
__exportStar(require("./interface/billing.payment.update.dto.interface"), exports);
|
|
45
43
|
__exportStar(require("./interface/client.affiliate.create.dto.interface"), exports);
|
|
46
44
|
__exportStar(require("./interface/client.affiliate.update.dto.interface"), exports);
|
|
47
45
|
__exportStar(require("./interface/role.create.dto.interface"), exports);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.billingTransactionFlowConfig = void 0;
|
|
4
|
+
const billing_transaction_action_enum_1 = require("../enums/billing-transaction-action.enum");
|
|
5
|
+
const billing_transaction_status_enum_1 = require("../enums/billing-transaction-status.enum");
|
|
6
|
+
const billing_transaction_enum_1 = require("../enums/billing.transaction.enum");
|
|
7
|
+
exports.billingTransactionFlowConfig = {
|
|
8
|
+
[billing_transaction_status_enum_1.BillingTransactionStatusEnum.APPROVED]: {
|
|
9
|
+
actions: {
|
|
10
|
+
[billing_transaction_action_enum_1.BillingTransactionActionEnum.EDIT]: {
|
|
11
|
+
permissions: ["BILLING_TRANSACTION_UPDATE_SELF"],
|
|
12
|
+
next: (data) => decideNextStatus(data),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
[billing_transaction_status_enum_1.BillingTransactionStatusEnum.WRITEOFF_APPROVAL_PENDING]: {
|
|
17
|
+
actions: {
|
|
18
|
+
[billing_transaction_action_enum_1.BillingTransactionActionEnum.APPROVE]: {
|
|
19
|
+
permissions: ["BILLING_TRANSACTION_APPROVER_PROJECT", "BILLING_TRANSACTION_APPROVER_ORG"],
|
|
20
|
+
next: () => billing_transaction_status_enum_1.BillingTransactionStatusEnum.APPROVED,
|
|
21
|
+
},
|
|
22
|
+
[billing_transaction_action_enum_1.BillingTransactionActionEnum.REJECT]: {
|
|
23
|
+
permissions: ["BILLING_TRANSACTION_APPROVER_PROJECT", "BILLING_TRANSACTION_APPROVER_ORG"],
|
|
24
|
+
next: () => billing_transaction_status_enum_1.BillingTransactionStatusEnum.REJECTED,
|
|
25
|
+
},
|
|
26
|
+
[billing_transaction_action_enum_1.BillingTransactionActionEnum.EDIT]: {
|
|
27
|
+
permissions: ["BILLING_TRANSACTION_UPDATE_SELF"],
|
|
28
|
+
next: (data) => decideNextStatus(data),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
[billing_transaction_status_enum_1.BillingTransactionStatusEnum.CREDITNOTE_APPROVAL_PENDING]: {
|
|
33
|
+
actions: {
|
|
34
|
+
[billing_transaction_action_enum_1.BillingTransactionActionEnum.APPROVE]: {
|
|
35
|
+
permissions: ["BILLING_TRANSACTION_APPROVER_PROJECT", "BILLING_TRANSACTION_APPROVER_ORG"],
|
|
36
|
+
next: () => billing_transaction_status_enum_1.BillingTransactionStatusEnum.APPROVED,
|
|
37
|
+
},
|
|
38
|
+
[billing_transaction_action_enum_1.BillingTransactionActionEnum.REJECT]: {
|
|
39
|
+
permissions: ["BILLING_TRANSACTION_APPROVER_PROJECT", "BILLING_TRANSACTION_APPROVER_ORG"],
|
|
40
|
+
next: () => billing_transaction_status_enum_1.BillingTransactionStatusEnum.REJECTED,
|
|
41
|
+
},
|
|
42
|
+
[billing_transaction_action_enum_1.BillingTransactionActionEnum.EDIT]: {
|
|
43
|
+
permissions: ["BILLING_TRANSACTION_UPDATE_SELF"],
|
|
44
|
+
next: (data) => decideNextStatus(data),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
function decideNextStatus(data) {
|
|
50
|
+
var _a;
|
|
51
|
+
const { currentBillingTransactionEntity, dto } = data;
|
|
52
|
+
const typeStatusMapping = {
|
|
53
|
+
[billing_transaction_enum_1.BillingTransactionType.WRITE_OFF]: billing_transaction_status_enum_1.BillingTransactionStatusEnum.WRITEOFF_APPROVAL_PENDING,
|
|
54
|
+
[billing_transaction_enum_1.BillingTransactionType.CREDIT_NOTE]: billing_transaction_status_enum_1.BillingTransactionStatusEnum.CREDITNOTE_APPROVAL_PENDING,
|
|
55
|
+
};
|
|
56
|
+
if (currentBillingTransactionEntity.type === dto.type) {
|
|
57
|
+
return currentBillingTransactionEntity.status;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (dto.type && dto.type in typeStatusMapping) {
|
|
61
|
+
return (_a = typeStatusMapping[dto.type]) !== null && _a !== void 0 ? _a : currentBillingTransactionEntity.status;
|
|
62
|
+
}
|
|
63
|
+
// otherwise → retain current status
|
|
64
|
+
return currentBillingTransactionEntity.status;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -23,8 +23,6 @@ export * from "./enums/billing.status.enum";
|
|
|
23
23
|
export * from "./enums/billing.timesheet.change.status.enum";
|
|
24
24
|
export * from "./interface/office.location.entity";
|
|
25
25
|
export * from "./interface/bank.entity.interface";
|
|
26
|
-
export * from "./enums/billing.payment.type.enum";
|
|
27
|
-
export * from "./interface/billing_payment.entity.interface";
|
|
28
26
|
export * from "./interface/client_affiliate_entity.interface";
|
|
29
27
|
export * from "./interface/permission.entity.interface";
|
|
30
28
|
export * from "./interface/role.entity.interface";
|
|
@@ -211,3 +209,4 @@ export * from "./enums/project-revenue-split-mapping-status.enum";
|
|
|
211
209
|
export * from "./enums/project-revenue-split.enum";
|
|
212
210
|
export * from "./interface/project-revenue-split-mapping.entity";
|
|
213
211
|
export * from "./model/project-revenue-split-mapping.model";
|
|
212
|
+
export * from "./flow-configs/billing-transaction.flow.config";
|
|
@@ -39,8 +39,6 @@ __exportStar(require("./enums/billing.status.enum"), exports);
|
|
|
39
39
|
__exportStar(require("./enums/billing.timesheet.change.status.enum"), exports);
|
|
40
40
|
__exportStar(require("./interface/office.location.entity"), exports);
|
|
41
41
|
__exportStar(require("./interface/bank.entity.interface"), exports);
|
|
42
|
-
__exportStar(require("./enums/billing.payment.type.enum"), exports);
|
|
43
|
-
__exportStar(require("./interface/billing_payment.entity.interface"), exports);
|
|
44
42
|
__exportStar(require("./interface/client_affiliate_entity.interface"), exports);
|
|
45
43
|
__exportStar(require("./interface/permission.entity.interface"), exports);
|
|
46
44
|
__exportStar(require("./interface/role.entity.interface"), exports);
|
|
@@ -227,3 +225,4 @@ __exportStar(require("./enums/project-revenue-split-mapping-status.enum"), expor
|
|
|
227
225
|
__exportStar(require("./enums/project-revenue-split.enum"), exports);
|
|
228
226
|
__exportStar(require("./interface/project-revenue-split-mapping.entity"), exports);
|
|
229
227
|
__exportStar(require("./model/project-revenue-split-mapping.model"), exports);
|
|
228
|
+
__exportStar(require("./flow-configs/billing-transaction.flow.config"), exports);
|
|
@@ -15,7 +15,6 @@ import { BillingTransactionHistoryEntityModel } from "../model/billing-transacti
|
|
|
15
15
|
import { BillingTransactionEntityModel } from "../model/billing-transaction.model";
|
|
16
16
|
import { BillingEntityModel } from "../model/billing.entity.model";
|
|
17
17
|
import { BillingHistoryEntityModel } from "../model/billing_history.entity.model";
|
|
18
|
-
import { BillingPaymentEntityModel } from "../model/billing_payment.entity.model";
|
|
19
18
|
import { BillingTimesheetHistoryEntityModel } from "../model/billing_timesheet_history.entity.model";
|
|
20
19
|
import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
|
|
21
20
|
import { ClientIntroducingMappingEntityModel } from "../model/client-introducing-mapping.entity.model";
|
|
@@ -79,7 +78,6 @@ import { IBillingReimbursementExpenseEntity } from "./billing-reimbursement-expe
|
|
|
79
78
|
import { IBillingTransactionHistoryEntity } from "./billing-transaction-history.entity";
|
|
80
79
|
import { IBillingEntity } from "./billing.entity.interface";
|
|
81
80
|
import { IBillingHistoryEntity } from "./billing_history.entity.interface";
|
|
82
|
-
import { IBillingPaymentEntity } from "./billing_payment.entity.interface";
|
|
83
81
|
import { IBillingProfileEntity } from "./billing_profile.entity.interface";
|
|
84
82
|
import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
85
83
|
import { IBillingTimesheetHistoryEntity } from "./billing_timesheet_history.entity.interface";
|
|
@@ -199,7 +197,6 @@ export declare enum EntityEnum {
|
|
|
199
197
|
BANK = "bank",
|
|
200
198
|
CLIENT_AFFILIATE = "client_affiliate",
|
|
201
199
|
BANK_HISTORY = "bank_history",
|
|
202
|
-
BILLING_PAYMENT = "billing_payment",
|
|
203
200
|
BILLING_TRANSACTION = "billing_transaction",
|
|
204
201
|
BILLING_TRANSACTION_HISTORY = "billing_transaction_history",
|
|
205
202
|
CONFIGURATION = "configuration",
|
|
@@ -258,7 +255,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
258
255
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
259
256
|
};
|
|
260
257
|
};
|
|
261
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : 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.
|
|
258
|
+
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : 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 : never) & {
|
|
262
259
|
id: number;
|
|
263
260
|
};
|
|
264
261
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -382,7 +379,7 @@ export declare enum VirtualEntityEnum {
|
|
|
382
379
|
}
|
|
383
380
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
384
381
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
385
|
-
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.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.
|
|
382
|
+
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.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 : UserEntityModel;
|
|
386
383
|
export type EntityMap = {
|
|
387
384
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
388
385
|
};
|
|
@@ -58,7 +58,6 @@ var EntityEnum;
|
|
|
58
58
|
EntityEnum["BANK"] = "bank";
|
|
59
59
|
EntityEnum["CLIENT_AFFILIATE"] = "client_affiliate";
|
|
60
60
|
EntityEnum["BANK_HISTORY"] = "bank_history";
|
|
61
|
-
EntityEnum["BILLING_PAYMENT"] = "billing_payment";
|
|
62
61
|
EntityEnum["BILLING_TRANSACTION"] = "billing_transaction";
|
|
63
62
|
EntityEnum["BILLING_TRANSACTION_HISTORY"] = "billing_transaction_history";
|
|
64
63
|
EntityEnum["CONFIGURATION"] = "configuration";
|
|
@@ -22,7 +22,6 @@ const billing_transaction_history_entity_model_1 = require("./billing-transactio
|
|
|
22
22
|
const billing_transaction_model_1 = require("./billing-transaction.model");
|
|
23
23
|
const billing_entity_model_1 = require("./billing.entity.model");
|
|
24
24
|
const billing_history_entity_model_1 = require("./billing_history.entity.model");
|
|
25
|
-
const billing_payment_entity_model_1 = require("./billing_payment.entity.model");
|
|
26
25
|
const billing_timesheet_history_entity_model_1 = require("./billing_timesheet_history.entity.model");
|
|
27
26
|
const client_affiliate_entity_model_1 = require("./client-affiliate.entity.model");
|
|
28
27
|
const client_introducing_mapping_entity_model_1 = require("./client-introducing-mapping.entity.model");
|
|
@@ -138,7 +137,6 @@ exports.entityEnumToEntityModel = {
|
|
|
138
137
|
[entity_utils_interface_1.EntityEnum.ADDRESS_BOOK]: address_book_model_1.AddressBookEntityModel.fromEntity,
|
|
139
138
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
140
139
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION_HISTORY]: billing_transaction_history_entity_model_1.BillingTransactionHistoryEntityModel.fromEntity,
|
|
141
|
-
[entity_utils_interface_1.EntityEnum.BILLING_PAYMENT]: billing_payment_entity_model_1.BillingPaymentEntityModel.fromEntity,
|
|
142
140
|
[entity_utils_interface_1.EntityEnum.STATE]: state_entity_model_1.StateEntityModel.fromEntity,
|
|
143
141
|
[entity_utils_interface_1.EntityEnum.GST_RATE]: gst_rate_entity_model_1.GstRateEntityModel.fromEntity,
|
|
144
142
|
[entity_utils_interface_1.EntityEnum.ORGANIZATION]: organization_entity_model_1.OrganizationEntityModel.fromEntity,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
|
|
1
|
+
import { EntityEnum, IEntityUpdateDto, Nullable } from "../interface/entity.utils.interface";
|
|
2
2
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
3
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
4
4
|
import { IVendorActionDataDto } from "../../api";
|
|
@@ -65,7 +65,9 @@ export declare class VendorEntityModel extends BaseEntityModel<EntityEnum.VENDOR
|
|
|
65
65
|
static relationConfigs: RelationConfigs<[EntityEnum.STATE], EntityEnum.VENDOR>;
|
|
66
66
|
static fromEntity(entity: IVendorEntity): VendorEntityModel;
|
|
67
67
|
getRelationConfigs(): any[];
|
|
68
|
-
getNextStatus(currentUser: IUserEntity,
|
|
68
|
+
getNextStatus(currentUser: IUserEntity, dto: IEntityUpdateDto<IVendorEntity> & {
|
|
69
|
+
actionData: IVendorActionDataDto;
|
|
70
|
+
}): VendorStatusEnum;
|
|
69
71
|
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
70
72
|
combinedActions?: Record<string, {
|
|
71
73
|
combineActions: VendorActionEnum[];
|
|
@@ -57,7 +57,7 @@ class VendorEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
57
57
|
getRelationConfigs() {
|
|
58
58
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
59
59
|
}
|
|
60
|
-
getNextStatus(currentUser,
|
|
60
|
+
getNextStatus(currentUser, dto) {
|
|
61
61
|
if (!this.status) {
|
|
62
62
|
throw new exceptions_1.AppBadRequestException({
|
|
63
63
|
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
@@ -71,17 +71,17 @@ class VendorEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
71
71
|
message: [`No flow configuration found for status: ${this.status}`],
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
if (!actionData) {
|
|
74
|
+
if (!(dto === null || dto === void 0 ? void 0 : dto.actionData)) {
|
|
75
75
|
throw new exceptions_1.AppBadRequestException({
|
|
76
76
|
key: error_key_enum_1.ErrorKeyEnum.ACTION_DATA,
|
|
77
|
-
message: ["actionData is required"],
|
|
77
|
+
message: ["dto.actionData is required"],
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
const matchingPermissionConfig = flowForStatus.actions[actionData.action];
|
|
80
|
+
const matchingPermissionConfig = flowForStatus.actions[dto.actionData.action];
|
|
81
81
|
if (!matchingPermissionConfig) {
|
|
82
82
|
throw new exceptions_1.AppBadRequestException({
|
|
83
83
|
key: error_key_enum_1.ErrorKeyEnum.ACTION,
|
|
84
|
-
message: [`Action '${actionData.action}' is not valid for the current status.`],
|
|
84
|
+
message: [`Action '${dto.actionData.action}' is not valid for the current status.`],
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
@@ -94,7 +94,7 @@ class VendorEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
94
94
|
if (!hasPermission) {
|
|
95
95
|
throw new exceptions_1.AppBadRequestException({
|
|
96
96
|
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
97
|
-
message: [`Current user does not have permission to ${actionData.action} vendor`],
|
|
97
|
+
message: [`Current user does not have permission to ${dto.actionData.action} vendor`],
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
const nextStatus = matchingPermissionConfig.next();
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BillingPaymentType = void 0;
|
|
4
|
-
var BillingPaymentType;
|
|
5
|
-
(function (BillingPaymentType) {
|
|
6
|
-
BillingPaymentType["NEFT"] = "NEFT";
|
|
7
|
-
BillingPaymentType["UTR"] = "UTR";
|
|
8
|
-
})(BillingPaymentType || (exports.BillingPaymentType = BillingPaymentType = {}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BillingPaymentType } from "../enums/billing.payment.type.enum";
|
|
2
|
-
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
-
import { IEntityFilterData } from "./entity.utils.interface";
|
|
4
|
-
export interface IBillingPaymentEntity extends IEntityAuditColumn {
|
|
5
|
-
id: number;
|
|
6
|
-
billingId: number;
|
|
7
|
-
bankId: number;
|
|
8
|
-
type: BillingPaymentType;
|
|
9
|
-
transactionId: string;
|
|
10
|
-
amount: number;
|
|
11
|
-
date: string;
|
|
12
|
-
tds: number;
|
|
13
|
-
discount: number;
|
|
14
|
-
}
|
|
15
|
-
export type IBillingPaymentEntityFilterData = IEntityFilterData<IBillingPaymentEntity>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { BillingPaymentType } from "../enums/billing.payment.type.enum";
|
|
2
|
-
import { IBillingPaymentEntity } from "../interface/billing_payment.entity.interface";
|
|
3
|
-
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
4
|
-
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
5
|
-
import { BankEntityModel } from "./bank.entity.model";
|
|
6
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
7
|
-
import { BillingEntityModel } from "./billing.entity.model";
|
|
8
|
-
export declare class BillingPaymentEntityModel extends BaseEntityModel<EntityEnum.BILLING_PAYMENT> implements IBillingPaymentEntity {
|
|
9
|
-
id: number;
|
|
10
|
-
billingId: number;
|
|
11
|
-
bankId: number;
|
|
12
|
-
type: BillingPaymentType;
|
|
13
|
-
transactionId: string;
|
|
14
|
-
amount: number;
|
|
15
|
-
date: string;
|
|
16
|
-
tds: number;
|
|
17
|
-
discount: number;
|
|
18
|
-
createdOn: number;
|
|
19
|
-
updatedOn: number;
|
|
20
|
-
createdBy: number;
|
|
21
|
-
updatedBy: number;
|
|
22
|
-
billing?: BillingEntityModel;
|
|
23
|
-
bank?: BankEntityModel;
|
|
24
|
-
static relationConfigs: RelationConfigs<[EntityEnum.BILLING, EntityEnum.BANK], EntityEnum.BILLING_PAYMENT>;
|
|
25
|
-
static fromEntity(entity: IBillingPaymentEntity): BillingPaymentEntityModel;
|
|
26
|
-
getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.BILLING, EntityEnum.BILLING_PAYMENT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.BANK, EntityEnum.BILLING_PAYMENT>];
|
|
27
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BillingPaymentEntityModel = void 0;
|
|
4
|
-
const billing_payment_type_enum_1 = require("../enums/billing.payment.type.enum");
|
|
5
|
-
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
6
|
-
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
|
-
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
-
class BillingPaymentEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.id = 0;
|
|
12
|
-
this.billingId = 0;
|
|
13
|
-
this.bankId = 0;
|
|
14
|
-
this.type = billing_payment_type_enum_1.BillingPaymentType.NEFT;
|
|
15
|
-
this.transactionId = "";
|
|
16
|
-
this.amount = 0;
|
|
17
|
-
this.date = "";
|
|
18
|
-
this.tds = 0;
|
|
19
|
-
this.discount = 0;
|
|
20
|
-
this.createdOn = 0;
|
|
21
|
-
this.updatedOn = 0;
|
|
22
|
-
this.createdBy = 0;
|
|
23
|
-
this.updatedBy = 0;
|
|
24
|
-
}
|
|
25
|
-
static fromEntity(entity) {
|
|
26
|
-
const result = new BillingPaymentEntityModel(entity_utils_interface_1.EntityEnum.BILLING_PAYMENT);
|
|
27
|
-
Object.assign(result, entity);
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
getRelationConfigs() {
|
|
31
|
-
return BillingPaymentEntityModel.relationConfigs;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.BillingPaymentEntityModel = BillingPaymentEntityModel;
|
|
35
|
-
BillingPaymentEntityModel.relationConfigs = [
|
|
36
|
-
{
|
|
37
|
-
name: entity_utils_interface_1.EntityEnum.BILLING,
|
|
38
|
-
relation: relation_type_enum_1.RelationType.ONE,
|
|
39
|
-
key: "billing",
|
|
40
|
-
mapKeyConfig: { relationKey: "id", key: "billingId" },
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: entity_utils_interface_1.EntityEnum.BANK,
|
|
44
|
-
relation: relation_type_enum_1.RelationType.ONE,
|
|
45
|
-
key: "bank",
|
|
46
|
-
mapKeyConfig: { relationKey: "id", key: "bankId" },
|
|
47
|
-
},
|
|
48
|
-
];
|