law-common 10.18.1-beta.8 → 10.18.1
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/jest.config.d.ts +3 -0
- package/dist/jest.config.js +11 -0
- package/dist/src/@api.d.ts +1 -0
- package/dist/src/@api.js +17 -0
- package/dist/src/@constants.d.ts +1 -0
- package/dist/src/@constants.js +17 -0
- package/dist/src/@entities.d.ts +1 -0
- package/dist/src/@entities.js +17 -0
- package/dist/src/@exceptions.d.ts +1 -0
- package/dist/src/@exceptions.js +17 -0
- package/dist/src/@misc.d.ts +1 -0
- package/dist/src/@misc.js +17 -0
- package/dist/src/api/index.d.ts +85 -0
- package/dist/src/api/index.js +101 -0
- package/dist/src/api/interface/bank.create.dto.interface.d.ts +6 -0
- package/dist/src/api/interface/bank.create.dto.interface.js +2 -0
- package/dist/src/api/interface/bank.entity.api.d.ts +3 -0
- package/dist/src/api/interface/bank.entity.api.js +2 -0
- package/dist/src/api/interface/bank.entity.response.d.ts +20 -0
- package/dist/src/api/interface/bank.entity.response.js +2 -0
- package/dist/src/api/interface/bank.update.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/bank.update.dto.interface.js +2 -0
- package/dist/src/api/interface/bank_history.api.d.ts +3 -0
- package/dist/src/api/interface/bank_history.api.js +2 -0
- package/dist/src/api/interface/base.response.interface.d.ts +6 -0
- package/dist/src/api/interface/base.response.interface.js +2 -0
- package/dist/src/api/interface/billing-reimbursement-expense-history.api.d.ts +4 -0
- package/dist/src/api/interface/billing-reimbursement-expense-history.api.js +2 -0
- package/dist/src/api/interface/billing-reimbursement-expense.api.d.ts +3 -0
- package/dist/src/api/interface/billing-reimbursement-expense.api.js +2 -0
- package/dist/src/api/interface/billing.create.dto.interface.d.ts +51 -0
- package/dist/src/api/interface/billing.create.dto.interface.js +2 -0
- package/dist/src/api/interface/billing.entity.api.d.ts +3 -0
- package/dist/src/api/interface/billing.entity.api.js +2 -0
- package/dist/src/api/interface/billing.entity.response.d.ts +37 -0
- package/dist/src/api/interface/billing.entity.response.js +2 -0
- package/dist/src/api/interface/billing.flow.update.dto.d.ts +4 -0
- package/dist/src/api/interface/billing.flow.update.dto.js +2 -0
- package/dist/src/api/interface/billing.history.api.d.ts +3 -0
- package/dist/src/api/interface/billing.history.api.js +2 -0
- package/dist/src/api/interface/billing.payment.create.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/billing.payment.create.dto.interface.js +2 -0
- package/dist/src/api/interface/billing.payment.entity.api.d.ts +3 -0
- package/dist/src/api/interface/billing.payment.entity.api.js +2 -0
- package/dist/src/api/interface/billing.payment.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/billing.payment.update.dto.interface.js +2 -0
- package/dist/src/api/interface/billing.timesheet.entity.api.d.ts +3 -0
- package/dist/src/api/interface/billing.timesheet.entity.api.js +2 -0
- package/dist/src/api/interface/billing.transaction.create.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/billing.transaction.create.dto.interface.js +2 -0
- package/dist/src/api/interface/billing.transaction.entity.response.d.ts +8 -0
- package/dist/src/api/interface/billing.transaction.entity.response.js +2 -0
- package/dist/src/api/interface/billing.transaction.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/billing.transaction.update.dto.interface.js +2 -0
- package/dist/src/api/interface/billing.update.dto.interface.d.ts +11 -0
- package/dist/src/api/interface/billing.update.dto.interface.js +2 -0
- package/dist/src/api/interface/billing_timesheet_history.api.d.ts +3 -0
- package/dist/src/api/interface/billing_timesheet_history.api.js +2 -0
- package/dist/src/api/interface/client.affiliate.create.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/client.affiliate.create.dto.interface.js +2 -0
- package/dist/src/api/interface/client.affiliate.entity.api.d.ts +3 -0
- package/dist/src/api/interface/client.affiliate.entity.api.js +2 -0
- package/dist/src/api/interface/client.affiliate.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/client.affiliate.update.dto.interface.js +2 -0
- package/dist/src/api/interface/client.entity.response.d.ts +14 -0
- package/dist/src/api/interface/client.entity.response.js +2 -0
- package/dist/src/api/interface/configuration.entity.response.d.ts +4 -0
- package/dist/src/api/interface/configuration.entity.response.js +2 -0
- package/dist/src/api/interface/country.entity.response.d.ts +4 -0
- package/dist/src/api/interface/country.entity.response.js +2 -0
- package/dist/src/api/interface/cron-job-manual-trigger.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/cron-job-manual-trigger.dto.interface.js +2 -0
- package/dist/src/api/interface/cron-job.entity.response.d.ts +7 -0
- package/dist/src/api/interface/cron-job.entity.response.js +2 -0
- package/dist/src/api/interface/designation.entity.response.d.ts +4 -0
- package/dist/src/api/interface/designation.entity.response.js +2 -0
- package/dist/src/api/interface/expense_type.create.dto.interface.d.ts +6 -0
- package/dist/src/api/interface/expense_type.create.dto.interface.js +2 -0
- package/dist/src/api/interface/expense_type.entity.api.d.ts +3 -0
- package/dist/src/api/interface/expense_type.entity.api.js +2 -0
- package/dist/src/api/interface/expense_type.entity.response.d.ts +4 -0
- package/dist/src/api/interface/expense_type.entity.response.js +2 -0
- package/dist/src/api/interface/expense_type.update.dto.d.ts +6 -0
- package/dist/src/api/interface/expense_type.update.dto.js +2 -0
- package/dist/src/api/interface/holiday-list.entity.response.d.ts +3 -0
- package/dist/src/api/interface/holiday-list.entity.response.js +2 -0
- package/dist/src/api/interface/holiday.entity.response.d.ts +3 -0
- package/dist/src/api/interface/holiday.entity.response.js +2 -0
- package/dist/src/api/interface/industry.entity.response.d.ts +3 -0
- package/dist/src/api/interface/industry.entity.response.js +2 -0
- package/dist/src/api/interface/intermediary.bank.entity.response.d.ts +3 -0
- package/dist/src/api/interface/intermediary.bank.entity.response.js +2 -0
- package/dist/src/api/interface/jwt.payload.interface.d.ts +4 -0
- package/dist/src/api/interface/jwt.payload.interface.js +2 -0
- package/dist/src/api/interface/leave.api.d.ts +18 -0
- package/dist/src/api/interface/leave.api.js +2 -0
- package/dist/src/api/interface/leave.create.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/leave.create.dto.interface.js +2 -0
- package/dist/src/api/interface/leave.update.dto.interface.d.ts +8 -0
- package/dist/src/api/interface/leave.update.dto.interface.js +2 -0
- package/dist/src/api/interface/leave_history.api.d.ts +3 -0
- package/dist/src/api/interface/leave_history.api.js +2 -0
- package/dist/src/api/interface/login.dto.interface.d.ts +4 -0
- package/dist/src/api/interface/login.dto.interface.js +2 -0
- package/dist/src/api/interface/login.response.interface.d.ts +5 -0
- package/dist/src/api/interface/login.response.interface.js +2 -0
- package/dist/src/api/interface/office.Location.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/office.Location.update.dto.interface.js +2 -0
- package/dist/src/api/interface/office.location.create.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/office.location.create.dto.interface.js +2 -0
- package/dist/src/api/interface/office.location.entity.api.d.ts +3 -0
- package/dist/src/api/interface/office.location.entity.api.js +2 -0
- package/dist/src/api/interface/office.location.entity.response.d.ts +4 -0
- package/dist/src/api/interface/office.location.entity.response.js +2 -0
- package/dist/src/api/interface/organization.entity.api.d.ts +3 -0
- package/dist/src/api/interface/organization.entity.api.js +2 -0
- package/dist/src/api/interface/permission.create.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/permission.create.dto.interface.js +2 -0
- package/dist/src/api/interface/permission.entity.api.d.ts +3 -0
- package/dist/src/api/interface/permission.entity.api.js +2 -0
- package/dist/src/api/interface/permission.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/permission.update.dto.interface.js +2 -0
- package/dist/src/api/interface/project-user-mapping.entity.api.d.ts +3 -0
- package/dist/src/api/interface/project-user-mapping.entity.api.js +2 -0
- package/dist/src/api/interface/project.entity.response.d.ts +28 -0
- package/dist/src/api/interface/project.entity.response.js +2 -0
- package/dist/src/api/interface/project.response.interface.d.ts +32 -0
- package/dist/src/api/interface/project.response.interface.js +2 -0
- package/dist/src/api/interface/rate.entity.response.d.ts +4 -0
- package/dist/src/api/interface/rate.entity.response.js +2 -0
- package/dist/src/api/interface/reimbursement.entity.response.d.ts +41 -0
- package/dist/src/api/interface/reimbursement.entity.response.js +2 -0
- package/dist/src/api/interface/reimbursement_expense.api.d.ts +3 -0
- package/dist/src/api/interface/reimbursement_expense.api.js +2 -0
- package/dist/src/api/interface/reimbursement_history.api.d.ts +3 -0
- package/dist/src/api/interface/reimbursement_history.api.js +2 -0
- package/dist/src/api/interface/role.create.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/role.create.dto.interface.js +2 -0
- package/dist/src/api/interface/role.entity.response.d.ts +3 -0
- package/dist/src/api/interface/role.entity.response.js +2 -0
- package/dist/src/api/interface/role.permission.mapping.create.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/role.permission.mapping.create.dto.interface.js +2 -0
- package/dist/src/api/interface/role.permission.mapping.delete.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/role.permission.mapping.delete.dto.interface.js +2 -0
- package/dist/src/api/interface/role.permission.mapping.entity.api.d.ts +4 -0
- package/dist/src/api/interface/role.permission.mapping.entity.api.js +2 -0
- package/dist/src/api/interface/role.permission.mapping.response.d.ts +5 -0
- package/dist/src/api/interface/role.permission.mapping.response.js +2 -0
- package/dist/src/api/interface/role.permission.mapping.update.dto.interface.d.ts +4 -0
- package/dist/src/api/interface/role.permission.mapping.update.dto.interface.js +2 -0
- package/dist/src/api/interface/role.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/role.update.dto.interface.js +2 -0
- package/dist/src/api/interface/task.create.dto.interface.d.ts +4 -0
- package/dist/src/api/interface/task.create.dto.interface.js +2 -0
- package/dist/src/api/interface/task.entity.api.d.ts +3 -0
- package/dist/src/api/interface/task.entity.api.js +2 -0
- package/dist/src/api/interface/task.entity.response.d.ts +4 -0
- package/dist/src/api/interface/task.entity.response.js +2 -0
- package/dist/src/api/interface/task.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/task.update.dto.interface.js +2 -0
- package/dist/src/api/interface/timesheet.entity.response.interface.d.ts +45 -0
- package/dist/src/api/interface/timesheet.entity.response.interface.js +2 -0
- package/dist/src/api/interface/timesheet.history.api.d.ts +3 -0
- package/dist/src/api/interface/timesheet.history.api.js +2 -0
- package/dist/src/api/interface/to-do.entity.api.d.ts +3 -0
- package/dist/src/api/interface/to-do.entity.api.js +2 -0
- package/dist/src/api/interface/user.create.dto.interace.d.ts +7 -0
- package/dist/src/api/interface/user.create.dto.interace.js +2 -0
- package/dist/src/api/interface/user.entity.api.d.ts +3 -0
- package/dist/src/api/interface/user.entity.api.js +2 -0
- package/dist/src/api/interface/user.entity.response.d.ts +4 -0
- package/dist/src/api/interface/user.entity.response.js +2 -0
- package/dist/src/api/interface/user.update.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/user.update.dto.interface.js +2 -0
- package/dist/src/api/interface/work.from.home.api.d.ts +21 -0
- package/dist/src/api/interface/work.from.home.api.js +2 -0
- package/dist/src/api/interface/work.from.home.create.dto.interface.d.ts +6 -0
- package/dist/src/api/interface/work.from.home.create.dto.interface.js +2 -0
- package/dist/src/api/interface/work.from.home.update.interface.d.ts +10 -0
- package/dist/src/api/interface/work.from.home.update.interface.js +2 -0
- package/dist/src/api/interface/work_from_home_history.api.d.ts +4 -0
- package/dist/src/api/interface/work_from_home_history.api.js +2 -0
- package/dist/src/constants/constants.d.ts +2 -0
- package/dist/src/constants/constants.js +6 -0
- package/dist/src/constants/entity_constants.d.ts +14 -0
- package/dist/src/constants/entity_constants.js +22 -0
- package/dist/src/constants/index.d.ts +3 -0
- package/dist/src/constants/index.js +19 -0
- package/dist/src/constants/util.constants.d.ts +2 -0
- package/dist/src/constants/util.constants.js +37 -0
- package/dist/src/entities/enums/bank_action.enum.d.ts +12 -0
- package/dist/src/entities/enums/bank_action.enum.js +43 -0
- package/dist/src/entities/enums/bank_status.enum.d.ts +13 -0
- package/dist/src/entities/enums/bank_status.enum.js +31 -0
- package/dist/src/entities/enums/billing-reimburement-expense-impact.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-reimburement-expense-impact.enum.js +9 -0
- package/dist/src/entities/enums/billing-reimbursement-expense-change-status.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-reimbursement-expense-change-status.enum.js +9 -0
- package/dist/src/entities/enums/billing-type.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-type.enum.js +9 -0
- package/dist/src/entities/enums/billing.action.enum.d.ts +19 -0
- package/dist/src/entities/enums/billing.action.enum.js +61 -0
- package/dist/src/entities/enums/billing.impact.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing.impact.enum.js +9 -0
- package/dist/src/entities/enums/billing.payment.type.enum.d.ts +4 -0
- package/dist/src/entities/enums/billing.payment.type.enum.js +8 -0
- package/dist/src/entities/enums/billing.status.enum.d.ts +12 -0
- package/dist/src/entities/enums/billing.status.enum.js +16 -0
- package/dist/src/entities/enums/billing.timesheet.change.status.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing.timesheet.change.status.enum.js +9 -0
- package/dist/src/entities/enums/billing.transaction.enum.d.ts +10 -0
- package/dist/src/entities/enums/billing.transaction.enum.js +28 -0
- package/dist/src/entities/enums/billing_invoice_type.enum.d.ts +4 -0
- package/dist/src/entities/enums/billing_invoice_type.enum.js +8 -0
- package/dist/src/entities/enums/configuration-key.enum.d.ts +8 -0
- package/dist/src/entities/enums/configuration-key.enum.js +23 -0
- package/dist/src/entities/enums/configuration.type.enum.d.ts +7 -0
- package/dist/src/entities/enums/configuration.type.enum.js +11 -0
- package/dist/src/entities/enums/country.entity.enum.d.ts +0 -0
- package/dist/src/entities/enums/country.entity.enum.js +42 -0
- package/dist/src/entities/enums/cron-jobs-name.enum.d.ts +3 -0
- package/dist/src/entities/enums/cron-jobs-name.enum.js +7 -0
- package/dist/src/entities/enums/cron-jobs-status.enum.d.ts +5 -0
- package/dist/src/entities/enums/cron-jobs-status.enum.js +9 -0
- package/dist/src/entities/enums/duration-type.enum.d.ts +16 -0
- package/dist/src/entities/enums/duration-type.enum.js +87 -0
- package/dist/src/entities/enums/entity_search_constraint_type.enum.d.ts +3 -0
- package/dist/src/entities/enums/entity_search_constraint_type.enum.js +7 -0
- package/dist/src/entities/enums/expense_type.entity.enum.d.ts +4 -0
- package/dist/src/entities/enums/expense_type.entity.enum.js +8 -0
- package/dist/src/entities/enums/history_operation.enum.d.ts +9 -0
- package/dist/src/entities/enums/history_operation.enum.js +27 -0
- package/dist/src/entities/enums/leave-type.enum.d.ts +8 -0
- package/dist/src/entities/enums/leave-type.enum.js +12 -0
- package/dist/src/entities/enums/leave.action.enum.d.ts +11 -0
- package/dist/src/entities/enums/leave.action.enum.js +41 -0
- package/dist/src/entities/enums/leave.status.enum.d.ts +13 -0
- package/dist/src/entities/enums/leave.status.enum.js +31 -0
- package/dist/src/entities/enums/organization.entity.enum.d.ts +4 -0
- package/dist/src/entities/enums/organization.entity.enum.js +8 -0
- package/dist/src/entities/enums/payment_status.enum.d.ts +4 -0
- package/dist/src/entities/enums/payment_status.enum.js +8 -0
- package/dist/src/entities/enums/project.entity.enum.d.ts +15 -0
- package/dist/src/entities/enums/project.entity.enum.js +20 -0
- package/dist/src/entities/enums/project_user_status.enum.d.ts +4 -0
- package/dist/src/entities/enums/project_user_status.enum.js +8 -0
- package/dist/src/entities/enums/reimbursement.entity.enum.d.ts +52 -0
- package/dist/src/entities/enums/reimbursement.entity.enum.js +111 -0
- package/dist/src/entities/enums/relation-type.enum.d.ts +4 -0
- package/dist/src/entities/enums/relation-type.enum.js +8 -0
- package/dist/src/entities/enums/task.entity.enum.d.ts +9 -0
- package/dist/src/entities/enums/task.entity.enum.js +14 -0
- package/dist/src/entities/enums/timesheet.action.enum.d.ts +13 -0
- package/dist/src/entities/enums/timesheet.action.enum.js +45 -0
- package/dist/src/entities/enums/timesheet.status.enum.d.ts +14 -0
- package/dist/src/entities/enums/timesheet.status.enum.js +32 -0
- package/dist/src/entities/enums/timezone.enum.d.ts +3 -0
- package/dist/src/entities/enums/timezone.enum.js +7 -0
- package/dist/src/entities/enums/user.entity.enum.d.ts +28 -0
- package/dist/src/entities/enums/user.entity.enum.js +51 -0
- package/dist/src/entities/enums/work.from.home.action.enum.d.ts +11 -0
- package/dist/src/entities/enums/work.from.home.action.enum.js +41 -0
- package/dist/src/entities/enums/work.from.home.status.enum.d.ts +13 -0
- package/dist/src/entities/enums/work.from.home.status.enum.js +31 -0
- package/dist/src/entities/func/convert-to-common-entity.func.d.ts +15 -0
- package/dist/src/entities/func/convert-to-common-entity.func.js +24 -0
- package/dist/src/entities/index.d.ts +98 -0
- package/dist/src/entities/index.js +115 -0
- package/dist/src/entities/interface/audit-column.entity.interface.d.ts +6 -0
- package/dist/src/entities/interface/audit-column.entity.interface.js +2 -0
- package/dist/src/entities/interface/bank.entity.interface.d.ts +25 -0
- package/dist/src/entities/interface/bank.entity.interface.js +2 -0
- package/dist/src/entities/interface/bank_history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/bank_history.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing-reimbursement-expense-history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/billing-reimbursement-expense-history.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing-reimbursement-expense.entity.interface.d.ts +23 -0
- package/dist/src/entities/interface/billing-reimbursement-expense.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing.entity.interface.d.ts +35 -0
- package/dist/src/entities/interface/billing.entity.interface.js +6 -0
- package/dist/src/entities/interface/billing_history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/billing_history.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing_payment.entity.interface.d.ts +15 -0
- package/dist/src/entities/interface/billing_payment.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing_timesheet.entity.interface.d.ts +50 -0
- package/dist/src/entities/interface/billing_timesheet.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing_timesheet_history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/billing_timesheet_history.entity.interface.js +2 -0
- package/dist/src/entities/interface/billing_transaction.entity.interface.d.ts +11 -0
- package/dist/src/entities/interface/billing_transaction.entity.interface.js +2 -0
- package/dist/src/entities/interface/client.entity.interface.d.ts +53 -0
- package/dist/src/entities/interface/client.entity.interface.js +2 -0
- package/dist/src/entities/interface/client_affiliate_entity.interface.d.ts +13 -0
- package/dist/src/entities/interface/client_affiliate_entity.interface.js +2 -0
- package/dist/src/entities/interface/configuration.entity.interface.d.ts +21 -0
- package/dist/src/entities/interface/configuration.entity.interface.js +2 -0
- package/dist/src/entities/interface/country.entity.interface.d.ts +11 -0
- package/dist/src/entities/interface/country.entity.interface.js +2 -0
- package/dist/src/entities/interface/cron-job.entity.interface.d.ts +20 -0
- package/dist/src/entities/interface/cron-job.entity.interface.js +2 -0
- package/dist/src/entities/interface/designation.entity.interface.d.ts +14 -0
- package/dist/src/entities/interface/designation.entity.interface.js +5 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +286 -0
- package/dist/src/entities/interface/entity.utils.interface.js +84 -0
- package/dist/src/entities/interface/expense_type.entity.interface.d.ts +11 -0
- package/dist/src/entities/interface/expense_type.entity.interface.js +2 -0
- package/dist/src/entities/interface/holiday-list.entity.interface.d.ts +12 -0
- package/dist/src/entities/interface/holiday-list.entity.interface.js +2 -0
- package/dist/src/entities/interface/holiday.entity.interface.d.ts +13 -0
- package/dist/src/entities/interface/holiday.entity.interface.js +2 -0
- package/dist/src/entities/interface/industry.entity.interface.d.ts +12 -0
- package/dist/src/entities/interface/industry.entity.interface.js +2 -0
- package/dist/src/entities/interface/intermediary_bank.entity.interface.d.ts +21 -0
- package/dist/src/entities/interface/intermediary_bank.entity.interface.js +2 -0
- package/dist/src/entities/interface/leave.entity.interface.d.ts +49 -0
- package/dist/src/entities/interface/leave.entity.interface.js +28 -0
- package/dist/src/entities/interface/leave_history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/leave_history.entity.interface.js +2 -0
- package/dist/src/entities/interface/office.location.entity.d.ts +11 -0
- package/dist/src/entities/interface/office.location.entity.js +2 -0
- package/dist/src/entities/interface/organization.entity.interface.d.ts +16 -0
- package/dist/src/entities/interface/organization.entity.interface.js +2 -0
- package/dist/src/entities/interface/permission.entity.interface.d.ts +9 -0
- package/dist/src/entities/interface/permission.entity.interface.js +2 -0
- package/dist/src/entities/interface/project.entity.interface.d.ts +79 -0
- package/dist/src/entities/interface/project.entity.interface.js +2 -0
- package/dist/src/entities/interface/rate.entity.interface.d.ts +18 -0
- package/dist/src/entities/interface/rate.entity.interface.js +2 -0
- package/dist/src/entities/interface/reimbursement.entity.interface.d.ts +62 -0
- package/dist/src/entities/interface/reimbursement.entity.interface.js +2 -0
- package/dist/src/entities/interface/reimbursement_expense.entity.interface.d.ts +32 -0
- package/dist/src/entities/interface/reimbursement_expense.entity.interface.js +2 -0
- package/dist/src/entities/interface/reimbursement_history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/reimbursement_history.entity.interface.js +2 -0
- package/dist/src/entities/interface/relation-config.interface.d.ts +16 -0
- package/dist/src/entities/interface/relation-config.interface.js +2 -0
- package/dist/src/entities/interface/role.entity.interface.d.ts +9 -0
- package/dist/src/entities/interface/role.entity.interface.js +2 -0
- package/dist/src/entities/interface/role.permission.mapping.entity.interface.d.ts +8 -0
- package/dist/src/entities/interface/role.permission.mapping.entity.interface.js +2 -0
- package/dist/src/entities/interface/task.entity.interface.d.ts +12 -0
- package/dist/src/entities/interface/task.entity.interface.js +2 -0
- package/dist/src/entities/interface/timesheet.entity.interface.d.ts +39 -0
- package/dist/src/entities/interface/timesheet.entity.interface.js +2 -0
- package/dist/src/entities/interface/timesheet_history.entity.interface.d.ts +9 -0
- package/dist/src/entities/interface/timesheet_history.entity.interface.js +2 -0
- package/dist/src/entities/interface/to-do.entity.interface.d.ts +19 -0
- package/dist/src/entities/interface/to-do.entity.interface.js +2 -0
- package/dist/src/entities/interface/user.entity.interface.d.ts +46 -0
- package/dist/src/entities/interface/user.entity.interface.js +5 -0
- package/dist/src/entities/interface/work_from_home.entity.interface.d.ts +17 -0
- package/dist/src/entities/interface/work_from_home.entity.interface.js +2 -0
- package/dist/src/entities/interface/work_from_home_history.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/work_from_home_history.entity.interface.js +2 -0
- package/dist/src/entities/model/bank.entity.model.d.ts +20 -0
- package/dist/src/entities/model/bank.entity.model.js +27 -0
- package/dist/src/entities/model/base.entity.model.d.ts +8 -0
- package/dist/src/entities/model/base.entity.model.js +69 -0
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.d.ts +25 -0
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.js +35 -0
- package/dist/src/entities/model/billing.entity.model.d.ts +79 -0
- package/dist/src/entities/model/billing.entity.model.js +228 -0
- package/dist/src/entities/model/client.entity.model.d.ts +35 -0
- package/dist/src/entities/model/client.entity.model.js +50 -0
- package/dist/src/entities/model/configuration.model.d.ts +19 -0
- package/dist/src/entities/model/configuration.model.js +32 -0
- package/dist/src/entities/model/designation.entity.model.d.ts +11 -0
- package/dist/src/entities/model/designation.entity.model.js +28 -0
- package/dist/src/entities/model/entity.model.interface.d.ts +8 -0
- package/dist/src/entities/model/entity.model.interface.js +69 -0
- package/dist/src/entities/model/holiday.entity.model.d.ts +14 -0
- package/dist/src/entities/model/holiday.entity.model.js +27 -0
- package/dist/src/entities/model/leave.entity.model.d.ts +73 -0
- package/dist/src/entities/model/leave.entity.model.js +217 -0
- package/dist/src/entities/model/leave_count.entity.model.d.ts +19 -0
- package/dist/src/entities/model/leave_count.entity.model.js +60 -0
- package/dist/src/entities/model/project-user-mapping.entity.model.d.ts +26 -0
- package/dist/src/entities/model/project-user-mapping.entity.model.js +49 -0
- package/dist/src/entities/model/project.entity.model.d.ts +40 -0
- package/dist/src/entities/model/project.entity.model.js +105 -0
- package/dist/src/entities/model/reimbursement-expense.entity.model.d.ts +27 -0
- package/dist/src/entities/model/reimbursement-expense.entity.model.js +43 -0
- package/dist/src/entities/model/reimbursement.entity.model.d.ts +32 -0
- package/dist/src/entities/model/reimbursement.entity.model.js +34 -0
- package/dist/src/entities/model/task.entity.model.d.ts +14 -0
- package/dist/src/entities/model/task.entity.model.js +23 -0
- package/dist/src/entities/model/timesheet.entity.model.d.ts +18 -0
- package/dist/src/entities/model/timesheet.entity.model.js +25 -0
- package/dist/src/entities/model/user.entity.model.d.ts +43 -0
- package/dist/src/entities/model/user.entity.model.js +30 -0
- package/dist/src/enums/currency.enum.d.ts +11 -0
- package/dist/src/enums/currency.enum.js +59 -0
- package/dist/src/enums/error.key.enum.d.ts +26 -0
- package/dist/src/enums/error.key.enum.js +30 -0
- package/dist/src/enums/index.d.ts +2 -0
- package/dist/src/enums/index.js +18 -0
- package/dist/src/enums/time.unit.enum.d.ts +16 -0
- package/dist/src/enums/time.unit.enum.js +73 -0
- package/dist/src/exceptions/impl/app-badrequest.exception.d.ts +6 -0
- package/dist/src/exceptions/impl/app-badrequest.exception.js +12 -0
- package/dist/src/exceptions/index.d.ts +3 -0
- package/dist/src/exceptions/index.js +19 -0
- package/dist/src/exceptions/interface/error.response.d.ts +9 -0
- package/dist/src/exceptions/interface/error.response.js +2 -0
- package/dist/src/exceptions/type/app-bad-request.exception.d.ts +5 -0
- package/dist/src/exceptions/type/app-bad-request.exception.js +2 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.js +36 -0
- package/dist/src/misc/index.d.ts +4 -0
- package/dist/src/misc/index.js +20 -0
- package/dist/src/misc/interface/modify.interface.d.ts +2 -0
- package/dist/src/misc/interface/modify.interface.js +2 -0
- package/dist/src/misc/interface/optional.interface.d.ts +2 -0
- package/dist/src/misc/interface/optional.interface.js +41 -0
- package/dist/src/misc/interface/upload-multer-file.interface.d.ts +8 -0
- package/dist/src/misc/interface/upload-multer-file.interface.js +2 -0
- package/dist/src/misc/models/dto-validation-type.d.ts +13 -0
- package/dist/src/misc/models/dto-validation-type.js +38 -0
- package/dist/src/misc/type/arrayed.type.d.ts +3 -0
- package/dist/src/misc/type/arrayed.type.js +2 -0
- package/dist/src/model/entities/interface/timesheet.model.interface.d.ts +3 -0
- package/dist/src/model/entities/interface/timesheet.model.interface.js +2 -0
- package/dist/src/model/entities/timesheet.model.d.ts +29 -0
- package/dist/src/model/entities/timesheet.model.js +43 -0
- package/dist/src/utils/date.util.d.ts +1 -0
- package/dist/src/utils/date.util.js +8 -0
- package/dist/src/utils/helper.fn.util.d.ts +243 -0
- package/dist/src/utils/helper.fn.util.js +521 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.js +20 -0
- package/dist/src/utils/models/date-code.model.util.d.ts +40 -0
- package/dist/src/utils/models/date-code.model.util.js +229 -0
- package/dist/src/utils/models/json.generator.d.ts +3 -0
- package/dist/src/utils/models/json.generator.js +20 -0
- package/dist/src/utils/number.util.d.ts +0 -0
- package/dist/src/utils/number.util.js +1 -0
- package/dist/src/utils/string.util.d.ts +1 -0
- package/dist/src/utils/string.util.js +15 -0
- package/dist/tests/date-code.model.util.spec.d.ts +1 -0
- package/dist/tests/date-code.model.util.spec.js +59 -0
- package/dist/tests/json.generator.spec.d.ts +1 -0
- package/dist/tests/json.generator.spec.js +35 -0
- package/dist/tests/sum.test.spec.d.ts +1 -0
- package/dist/tests/sum.test.spec.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.groupByFunction = groupByFunction;
|
|
13
|
+
exports.groupByOneToOneFunction = groupByOneToOneFunction;
|
|
14
|
+
exports.convertMapToObject = convertMapToObject;
|
|
15
|
+
exports.removeSamePropertyValues = removeSamePropertyValues;
|
|
16
|
+
exports.getChangedProperties = getChangedProperties;
|
|
17
|
+
exports.compareObjects = compareObjects;
|
|
18
|
+
exports.removeElementsFromArray = removeElementsFromArray;
|
|
19
|
+
exports.arrayDifference = arrayDifference;
|
|
20
|
+
exports.arrayIntersection = arrayIntersection;
|
|
21
|
+
exports.arrayIntersectionWith = arrayIntersectionWith;
|
|
22
|
+
exports.arrayUnion = arrayUnion;
|
|
23
|
+
exports.sumArray = sumArray;
|
|
24
|
+
exports.newRemoved = newRemoved;
|
|
25
|
+
exports.getEnumNames = getEnumNames;
|
|
26
|
+
exports.getFilterByPermission = getFilterByPermission;
|
|
27
|
+
exports.getFilterByPermissionFn = getFilterByPermissionFn;
|
|
28
|
+
exports.getPropertyFilterByPermissionFn = getPropertyFilterByPermissionFn;
|
|
29
|
+
exports.setResponseValue = setResponseValue;
|
|
30
|
+
exports.numberToWordsIndian = numberToWordsIndian;
|
|
31
|
+
exports.minutesToHoursMinutes = minutesToHoursMinutes;
|
|
32
|
+
exports.createKeyLabelMap = createKeyLabelMap;
|
|
33
|
+
exports.transformDate = transformDate;
|
|
34
|
+
exports.capitalizeFirstWord = capitalizeFirstWord;
|
|
35
|
+
exports.getEntitiesFromSearchV2Response = getEntitiesFromSearchV2Response;
|
|
36
|
+
exports.areDecimalNumbersEqual = areDecimalNumbersEqual;
|
|
37
|
+
exports.formatIndianNumber = formatIndianNumber;
|
|
38
|
+
exports.findDuplicateIds = findDuplicateIds;
|
|
39
|
+
exports.getDecimalNumberFromString = getDecimalNumberFromString;
|
|
40
|
+
exports.hasProperty = hasProperty;
|
|
41
|
+
const util_constants_1 = require("../constants/util.constants");
|
|
42
|
+
const error_key_enum_1 = require("../enums/error.key.enum");
|
|
43
|
+
const exceptions_1 = require("../exceptions");
|
|
44
|
+
function groupByFunction(list, keyGetter) {
|
|
45
|
+
const map = new Map();
|
|
46
|
+
list.forEach((item) => {
|
|
47
|
+
const key = keyGetter(item);
|
|
48
|
+
const collection = map.get(key);
|
|
49
|
+
if (!collection) {
|
|
50
|
+
map.set(key, [item]);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
collection.push(item);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return map;
|
|
57
|
+
}
|
|
58
|
+
function groupByOneToOneFunction(list, keyGetter) {
|
|
59
|
+
const map = new Map();
|
|
60
|
+
list.forEach((item) => {
|
|
61
|
+
const key = keyGetter(item);
|
|
62
|
+
map.set(key, item);
|
|
63
|
+
});
|
|
64
|
+
return map;
|
|
65
|
+
}
|
|
66
|
+
function convertMapToObject(map) {
|
|
67
|
+
return Object.fromEntries(map);
|
|
68
|
+
}
|
|
69
|
+
function removeSamePropertyValues(source, target) {
|
|
70
|
+
for (let key in target) {
|
|
71
|
+
// remove if null in source and target
|
|
72
|
+
if (source[key] === null && target[key] === null) {
|
|
73
|
+
delete target[key];
|
|
74
|
+
}
|
|
75
|
+
if (source[key] && source[key] === target[key]) {
|
|
76
|
+
delete target[key];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function getChangedProperties(source, target) {
|
|
81
|
+
const result = {};
|
|
82
|
+
for (let key in target) {
|
|
83
|
+
if (source[key] !== target[key]) {
|
|
84
|
+
result[key] = target[key];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
function compareObjects(obj1, obj2) {
|
|
90
|
+
if (obj1 === obj2)
|
|
91
|
+
return true;
|
|
92
|
+
if (!obj1 || !obj2)
|
|
93
|
+
return false;
|
|
94
|
+
const keys1 = Object.keys(obj1);
|
|
95
|
+
const keys2 = Object.keys(obj2);
|
|
96
|
+
if (keys1.length !== keys2.length)
|
|
97
|
+
return false;
|
|
98
|
+
return keys1.every((key) => {
|
|
99
|
+
const val1 = obj1[key];
|
|
100
|
+
const val2 = obj2[key];
|
|
101
|
+
if (typeof val1 === "object" &&
|
|
102
|
+
val1 !== null &&
|
|
103
|
+
typeof val2 === "object" &&
|
|
104
|
+
val2 !== null) {
|
|
105
|
+
return compareObjects(val1, val2);
|
|
106
|
+
}
|
|
107
|
+
return (val1 !== null && val1 !== void 0 ? val1 : null) === (val2 !== null && val2 !== void 0 ? val2 : null);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Removes elements from the target array that are present in the source array.
|
|
112
|
+
*
|
|
113
|
+
* @template T - The type of elements in the arrays.
|
|
114
|
+
* @param {T[]} source - The array containing elements to be excluded from the target array.
|
|
115
|
+
* @param {T[]} target - The array from which elements will be filtered out.
|
|
116
|
+
* @returns {T[]} A new array containing elements from the target array that are not present in the source array.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* const source = [1, 2, 3];
|
|
120
|
+
* const target = [1, 2, 3, 4, 5, 6];
|
|
121
|
+
* const result = removeElementsFromArray(source, target);
|
|
122
|
+
* console.log(result); // Output: [4, 5, 6]
|
|
123
|
+
*/
|
|
124
|
+
function removeElementsFromArray(source, target) {
|
|
125
|
+
return target.filter((element) => !source.includes(element));
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Returns a new array with elements from the target array that are not present in the source array.
|
|
129
|
+
*
|
|
130
|
+
* @template T - The type of elements in the arrays.
|
|
131
|
+
* @param {T[]} source - The array containing elements to be excluded from the target array.
|
|
132
|
+
* @param {T[]} target - The array from which elements will be filtered out.
|
|
133
|
+
* @returns {T[]} A new array containing elements from the target array that are not present in the source array.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* const source = [1, 2, 3];
|
|
137
|
+
* const target = [1, 2, 3, 4, 5, 6];
|
|
138
|
+
* const result = arrayDifference(source, target);
|
|
139
|
+
* console.log(result); // Output: [4, 5, 6]
|
|
140
|
+
*/
|
|
141
|
+
function arrayDifference(source, target) {
|
|
142
|
+
return target.filter((element) => !source.includes(element));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Returns a new array containing elements that are present in both the source and target arrays.
|
|
146
|
+
*
|
|
147
|
+
* @template T - The type of elements in the arrays.
|
|
148
|
+
* @param {T[]} source - The first array to compare.
|
|
149
|
+
* @param {T[]} target - The second array to compare.
|
|
150
|
+
* @returns {T[]} A new array containing elements that are present in both the source and target arrays.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* const source = [1, 2, 3];
|
|
154
|
+
* const target = [2, 3, 4];
|
|
155
|
+
* const result = arrayIntersection(source, target);
|
|
156
|
+
* console.log(result); // Output: [2, 3]
|
|
157
|
+
*/
|
|
158
|
+
function arrayIntersection(source, target) {
|
|
159
|
+
return target.filter((element) => source.includes(element));
|
|
160
|
+
}
|
|
161
|
+
// js docs
|
|
162
|
+
/**
|
|
163
|
+
* Returns a new array containing elements that are present in both the source and target arrays.
|
|
164
|
+
*
|
|
165
|
+
* @template T - The type of elements in the arrays.
|
|
166
|
+
* @param {T[]} source - The first array to compare.
|
|
167
|
+
* @param {T[]} target - The second array to compare.
|
|
168
|
+
* @param {(a: T, b: T) => boolean} comparator - The function to determine if two elements are equal.
|
|
169
|
+
* @returns {T[]} A new array containing elements that are present in both the source and target arrays.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* const source = [{ id: 1, name: "John" }, { id: 2, name: "Jane" }];
|
|
173
|
+
* const target = [{ id: 2, name: "Jane" }, { id: 3, name: "Doe" }];
|
|
174
|
+
* const result = arrayIntersectionWith(source, target, (a, b) => a.id === b.id);
|
|
175
|
+
* console.log(result); // Output: [{ id: 2, name: "Jane" }]
|
|
176
|
+
*/
|
|
177
|
+
function arrayIntersectionWith(source, target, comparator) {
|
|
178
|
+
return target.filter((element) => source.some((item) => comparator(item, element)));
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Returns a new array containing elements that are present in either the source or target arrays.
|
|
182
|
+
*
|
|
183
|
+
* @template T - The type of elements in the arrays.
|
|
184
|
+
* @param {T[]} source - The first array to compare.
|
|
185
|
+
* @param {T[]} target - The second array to compare.
|
|
186
|
+
* @returns {T[]} A new array containing elements that are present in either the source or target arrays.
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* const source = [1, 2, 3];
|
|
190
|
+
* const target = [2, 3, 4];
|
|
191
|
+
* const result = arrayUnion(source, target);
|
|
192
|
+
* console.log(result); // Output: [1, 2, 3, 4]
|
|
193
|
+
*/
|
|
194
|
+
function arrayUnion(source, target) {
|
|
195
|
+
return [...new Set([...source, ...target])];
|
|
196
|
+
}
|
|
197
|
+
function sumArray(array, key) {
|
|
198
|
+
return array.reduce((acc, item) => acc + Number(item[key]), 0);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Compares existing and incoming arrays and returns the added, deleted, and present elements.
|
|
202
|
+
*
|
|
203
|
+
* @template T - The type of elements in the arrays.
|
|
204
|
+
* @param {T[]} existing - The existing array.
|
|
205
|
+
* @param {T[]} incoming - The incoming array.
|
|
206
|
+
* @returns {{ added: T[]; deleted: T[]; present: T[] }} An object containing arrays of added, deleted, and present elements.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* const existing = [1, 2, 3];
|
|
210
|
+
* const incoming = [2, 3, 4];
|
|
211
|
+
* const result = newRemoved(existing, incoming);
|
|
212
|
+
* console.log(result); // Output: { added: [4], deleted: [1], present: [2, 3, 4] }
|
|
213
|
+
*/
|
|
214
|
+
function newRemoved(existing, incoming) {
|
|
215
|
+
existing = existing || [];
|
|
216
|
+
incoming = incoming || [];
|
|
217
|
+
const added = arrayDifference(existing, incoming);
|
|
218
|
+
const deleted = arrayDifference(incoming, existing);
|
|
219
|
+
const present = arrayUnion(arrayIntersection(existing, incoming), added);
|
|
220
|
+
return { added, deleted, present };
|
|
221
|
+
}
|
|
222
|
+
function getEnumNames(enumType) {
|
|
223
|
+
return Object.values(enumType).filter((value) => typeof value === "string");
|
|
224
|
+
}
|
|
225
|
+
function getFilterByPermission(permissionFilterConfig, propertyName, userPermission, filterDto, emptyValue = []) {
|
|
226
|
+
const dtoFilter = filterDto[propertyName];
|
|
227
|
+
const permissionFilter = permissionFilterConfig[userPermission][propertyName];
|
|
228
|
+
const isDtoFilterIdPresent = dtoFilter && dtoFilter.length > 0;
|
|
229
|
+
const isPermissionFilterIdPresent = permissionFilter && permissionFilter.length > 0;
|
|
230
|
+
return {
|
|
231
|
+
[propertyName]: isPermissionFilterIdPresent
|
|
232
|
+
? isDtoFilterIdPresent
|
|
233
|
+
? arrayIntersection(permissionFilter, dtoFilter).length > 0
|
|
234
|
+
? arrayIntersection(permissionFilter, dtoFilter)
|
|
235
|
+
: emptyValue
|
|
236
|
+
: permissionFilter
|
|
237
|
+
: dtoFilter,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function getFilterByPermissionFn(permissionFilterConfig_1, propertyName_1, userPermission_1, filterDto_1) {
|
|
241
|
+
return __awaiter(this, arguments, void 0, function* (permissionFilterConfig, propertyName, userPermission, filterDto, emptyValue = []) {
|
|
242
|
+
const filterData = yield permissionFilterConfig[userPermission]();
|
|
243
|
+
const dtoFilter = filterDto[propertyName];
|
|
244
|
+
const permissionFilter = filterData[propertyName];
|
|
245
|
+
const isDtoFilterIdPresent = dtoFilter && dtoFilter.length > 0;
|
|
246
|
+
const isPermissionFilterIdPresent = permissionFilter && permissionFilter.length > 0;
|
|
247
|
+
return {
|
|
248
|
+
[propertyName]: isPermissionFilterIdPresent
|
|
249
|
+
? isDtoFilterIdPresent
|
|
250
|
+
? arrayIntersection(permissionFilter, dtoFilter).length > 0
|
|
251
|
+
? arrayIntersection(permissionFilter, dtoFilter)
|
|
252
|
+
: emptyValue
|
|
253
|
+
: permissionFilter
|
|
254
|
+
: dtoFilter,
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
function getPropertyFilterByPermissionFn(permissionFilterConfig_1, propertyNames_1, userPermission_1, filterDto_1) {
|
|
259
|
+
return __awaiter(this, arguments, void 0, function* (permissionFilterConfig, propertyNames, userPermission, filterDto, emptyValue = []) {
|
|
260
|
+
const filterData = yield permissionFilterConfig[userPermission]();
|
|
261
|
+
const result = {};
|
|
262
|
+
for (const propertyName of propertyNames) {
|
|
263
|
+
const dtoFilter = filterDto[propertyName];
|
|
264
|
+
const permissionFilter = filterData[propertyName];
|
|
265
|
+
const isDtoFilterIdPresent = dtoFilter && dtoFilter.length > 0;
|
|
266
|
+
const isPermissionFilterIdPresent = permissionFilter && permissionFilter.length > 0;
|
|
267
|
+
result[propertyName] =
|
|
268
|
+
isPermissionFilterIdPresent
|
|
269
|
+
? isDtoFilterIdPresent
|
|
270
|
+
? arrayIntersection(permissionFilter, dtoFilter).length > 0
|
|
271
|
+
? arrayIntersection(permissionFilter, dtoFilter)
|
|
272
|
+
: emptyValue
|
|
273
|
+
: permissionFilter
|
|
274
|
+
: dtoFilter;
|
|
275
|
+
}
|
|
276
|
+
return result;
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Sets a property value on an object with proper TypeScript type safety.
|
|
281
|
+
*
|
|
282
|
+
* @template T - The type of the target object.
|
|
283
|
+
* @template K - The type of the key, constrained to the keys of T.
|
|
284
|
+
* @param {T} obj - The object on which the value should be set.
|
|
285
|
+
* @param {K} key - The key of the property to update.
|
|
286
|
+
* @param {T[K]} value - The new value to assign to the property.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* interface User {
|
|
290
|
+
* name: string;
|
|
291
|
+
* age: number;
|
|
292
|
+
* }
|
|
293
|
+
*
|
|
294
|
+
* const user: User = { name: 'Alice', age: 25 };
|
|
295
|
+
* setResponseValue(user, 'age', 30);
|
|
296
|
+
* console.log(user); // Output: { name: 'Alice', age: 30 }
|
|
297
|
+
*/
|
|
298
|
+
function setResponseValue(obj, key, value) {
|
|
299
|
+
obj[key] = value;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Converts a numeric string into words following the Indian numbering system.
|
|
303
|
+
*
|
|
304
|
+
* @param {string} numStr - The number in string format. Can contain commas (e.g., "1,23,456").
|
|
305
|
+
*
|
|
306
|
+
* @returns {string} The number expressed in words using the Indian format (e.g., Crores, Lakhs).
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* const ones = ["", "One", "Two", "Three", ..., "Nineteen"];
|
|
310
|
+
* const tens = ["", "", "Twenty", "Thirty", ..., "Ninety"];
|
|
311
|
+
*
|
|
312
|
+
* numberToWordsIndian("1,23,456", ones, tens);
|
|
313
|
+
* // Output: "One Lakh Twenty Three Thousand Four Hundred Fifty Six"
|
|
314
|
+
*/
|
|
315
|
+
function numberToWordsIndian(numStr) {
|
|
316
|
+
const ones = util_constants_1.onesValues;
|
|
317
|
+
const tens = util_constants_1.tensValues;
|
|
318
|
+
function twoDigits(n) {
|
|
319
|
+
if (n < 20)
|
|
320
|
+
return ones[n];
|
|
321
|
+
return tens[Math.floor(n / 10)] + (n % 10 !== 0 ? " " + ones[n % 10] : "");
|
|
322
|
+
}
|
|
323
|
+
function threeDigits(n) {
|
|
324
|
+
if (n < 100)
|
|
325
|
+
return twoDigits(n);
|
|
326
|
+
return (ones[Math.floor(n / 100)] +
|
|
327
|
+
" Hundred" +
|
|
328
|
+
(n % 100 !== 0 ? " " + twoDigits(n % 100) : ""));
|
|
329
|
+
}
|
|
330
|
+
// Remove commas and convert to number
|
|
331
|
+
const num = parseInt(numStr.replace(/,/g, ""), 10);
|
|
332
|
+
if (isNaN(num))
|
|
333
|
+
return "Invalid number";
|
|
334
|
+
if (num === 0)
|
|
335
|
+
return "Zero";
|
|
336
|
+
const crore = Math.floor(num / 10000000);
|
|
337
|
+
const lakh = Math.floor((num % 10000000) / 100000);
|
|
338
|
+
const thousand = Math.floor((num % 100000) / 1000);
|
|
339
|
+
const hundred = num % 1000;
|
|
340
|
+
let words = "";
|
|
341
|
+
if (crore)
|
|
342
|
+
words += threeDigits(crore) + " Crore ";
|
|
343
|
+
if (lakh)
|
|
344
|
+
words += threeDigits(lakh) + " Lakh ";
|
|
345
|
+
if (thousand)
|
|
346
|
+
words += threeDigits(thousand) + " Thousand ";
|
|
347
|
+
if (hundred)
|
|
348
|
+
words += threeDigits(hundred);
|
|
349
|
+
return words.trim();
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Converts a total number of minutes into a formatted "HH:MM" string.
|
|
353
|
+
*
|
|
354
|
+
* @param {number} totalMinutes - The total number of minutes to convert.
|
|
355
|
+
*
|
|
356
|
+
* @returns {string} A string representing the equivalent time in "HH:MM" format,
|
|
357
|
+
* with hours and minutes padded to two digits.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* minutesToHoursMinutes(75); // Output: "01:15"
|
|
361
|
+
* minutesToHoursMinutes(5); // Output: "00:05"
|
|
362
|
+
* minutesToHoursMinutes(135);// Output: "02:15"
|
|
363
|
+
*/
|
|
364
|
+
function minutesToHoursMinutes(totalMinutes) {
|
|
365
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
366
|
+
const minutes = totalMinutes % 60;
|
|
367
|
+
const hoursStr = hours.toString().padStart(2, "0");
|
|
368
|
+
const minutesStr = minutes.toString().padStart(2, "0");
|
|
369
|
+
return `${hoursStr}:${minutesStr}`;
|
|
370
|
+
}
|
|
371
|
+
function createKeyLabelMap() {
|
|
372
|
+
return new Proxy({}, {
|
|
373
|
+
get: (_, prop) => {
|
|
374
|
+
// Convert camelCase to words (e.g., employeeId -> Employee ID)
|
|
375
|
+
return prop
|
|
376
|
+
.replace(/([a-z])([A-Z])/g, "$1 $2")
|
|
377
|
+
.split(" ")
|
|
378
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
379
|
+
.join(" ");
|
|
380
|
+
},
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
function transformDate(obj) {
|
|
384
|
+
return Object.assign(Object.assign({}, obj), { date: obj.date.toISOString() });
|
|
385
|
+
}
|
|
386
|
+
function capitalizeFirstWord(str) {
|
|
387
|
+
if (!str)
|
|
388
|
+
return str;
|
|
389
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
390
|
+
}
|
|
391
|
+
function getEntitiesFromSearchV2Response(searchResponseV2, entityEnumKey, EntityClass) {
|
|
392
|
+
var _a;
|
|
393
|
+
if (!searchResponseV2.relatedEntities) {
|
|
394
|
+
throw new exceptions_1.AppBadRequestException({
|
|
395
|
+
key: error_key_enum_1.ErrorKeyEnum.RELATED_ENTITIES,
|
|
396
|
+
message: ["Invalid Search Operation"],
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
return (((_a = searchResponseV2.relatedEntities[entityEnumKey]) === null || _a === void 0 ? void 0 : _a.baseEntities) || []).map((entity) => Object.assign(new EntityClass(), entity));
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Checks if two decimal numbers are approximately equal within a given tolerance.
|
|
403
|
+
*
|
|
404
|
+
* @param {number} firstValue - The first number to compare.
|
|
405
|
+
* @param {number} secondValue - The second number to compare.
|
|
406
|
+
* @param {number} allowedDifference - The maximum difference allowed for the numbers
|
|
407
|
+
* to be considered equal.
|
|
408
|
+
*
|
|
409
|
+
* @returns {boolean} Returns `true` if the numbers are within the allowed difference;
|
|
410
|
+
* otherwise, returns `false`.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* areDecimalNumbersEqual(5483.86, 5483.87, 0.5); // true
|
|
414
|
+
* areDecimalNumbersEqual(5483.86, 5484.5, 0.5); // false
|
|
415
|
+
*/
|
|
416
|
+
function areDecimalNumbersEqual(firstValue, secondValue, allowedDifference = 0.5) {
|
|
417
|
+
// Calculate the absolute difference between both values
|
|
418
|
+
const actualDifference = Math.abs(firstValue - secondValue);
|
|
419
|
+
// Return true if the actual difference is less than or equal to the allowed difference
|
|
420
|
+
return actualDifference <= allowedDifference;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Formats a number into the Indian numbering system with commas.
|
|
424
|
+
*
|
|
425
|
+
* - Ensures **two decimal places**.
|
|
426
|
+
* - Applies Indian digit grouping: last 3 digits, then groups of 2 (e.g., 1,23,456.00).
|
|
427
|
+
* - Accepts both `number` and `string` input.
|
|
428
|
+
* - Returns an empty string if the input is not a valid number.
|
|
429
|
+
*
|
|
430
|
+
* @param {number | string} amount - The number or numeric string to format.
|
|
431
|
+
* @returns {string} The formatted number as a string in Indian number format.
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* formatIndianNumber(123456); // "1,23,456.00"
|
|
435
|
+
* formatIndianNumber(1891250); // "18,91,250.00"
|
|
436
|
+
* formatIndianNumber("21250"); // "21,250.00"
|
|
437
|
+
* formatIndianNumber("abc"); // ""
|
|
438
|
+
*/
|
|
439
|
+
function formatIndianNumber(amount) {
|
|
440
|
+
let num = Number(amount);
|
|
441
|
+
if (isNaN(num))
|
|
442
|
+
return "";
|
|
443
|
+
// Ensure 2 decimal places
|
|
444
|
+
let [integerPart, decimalPart] = num.toFixed(2).split(".");
|
|
445
|
+
// Indian grouping: last 3 digits, then groups of 2
|
|
446
|
+
let lastThree = integerPart.slice(-3);
|
|
447
|
+
let otherNumbers = integerPart.slice(0, -3);
|
|
448
|
+
if (otherNumbers !== "") {
|
|
449
|
+
lastThree = "," + lastThree;
|
|
450
|
+
}
|
|
451
|
+
let formattedInt = otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
|
|
452
|
+
return formattedInt + "." + decimalPart;
|
|
453
|
+
}
|
|
454
|
+
function findDuplicateIds(ids) {
|
|
455
|
+
const seen = new Set();
|
|
456
|
+
const duplicates = new Set();
|
|
457
|
+
for (const id of ids) {
|
|
458
|
+
if (seen.has(id)) {
|
|
459
|
+
duplicates.add(id);
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
seen.add(id);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return Array.from(duplicates);
|
|
466
|
+
}
|
|
467
|
+
function getDecimalNumberFromString(value, placesAfterDecimal = 2) {
|
|
468
|
+
// this method should internally handle if the value is number or string
|
|
469
|
+
return Number(Number(value).toFixed(placesAfterDecimal));
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Recursively checks if a specified property exists in an object or its nested objects.
|
|
473
|
+
* Skips properties with array values and does not check their contents.
|
|
474
|
+
* The property is considered present if it exists in the object and its value is not undefined.
|
|
475
|
+
*
|
|
476
|
+
* @template T - The type of the input object, constrained to be an object.
|
|
477
|
+
* @param obj - The object to check for the property. Can be null or undefined.
|
|
478
|
+
* @param propName - The name of the property to search for.
|
|
479
|
+
* @returns True if the property exists in the object or any nested non-array object and is not undefined; false otherwise.
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```typescript
|
|
483
|
+
* interface MyObject {
|
|
484
|
+
* name?: string;
|
|
485
|
+
* details?: { age?: number; tags?: string[] };
|
|
486
|
+
* }
|
|
487
|
+
*
|
|
488
|
+
* const obj: MyObject = {
|
|
489
|
+
* name: "Alice",
|
|
490
|
+
* details: { age: 30, tags: ["test"] }
|
|
491
|
+
* };
|
|
492
|
+
*
|
|
493
|
+
* console.log(hasProperty(obj, "name")); // true
|
|
494
|
+
* console.log(hasProperty(obj, "age")); // true (nested in details)
|
|
495
|
+
* console.log(hasProperty(obj, "tags")); // false (tags is an array, skipped)
|
|
496
|
+
* console.log(hasProperty(obj, "unknown")); // false
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
function hasProperty(obj, propName) {
|
|
500
|
+
if (!obj || typeof obj !== "object" || Array.isArray(obj)) {
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
// Check if the property exists at the current level
|
|
504
|
+
if (propName in obj && obj[propName] !== undefined) {
|
|
505
|
+
return true;
|
|
506
|
+
}
|
|
507
|
+
// Recursively check all nested objects, skipping arrays
|
|
508
|
+
for (const key in obj) {
|
|
509
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
510
|
+
const value = obj[key];
|
|
511
|
+
if (typeof value === "object" &&
|
|
512
|
+
value !== null &&
|
|
513
|
+
!Array.isArray(value)) {
|
|
514
|
+
if (hasProperty(value, propName)) {
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return false;
|
|
521
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./date.util"), exports);
|
|
18
|
+
__exportStar(require("./helper.fn.util"), exports);
|
|
19
|
+
__exportStar(require("./models/date-code.model.util"), exports);
|
|
20
|
+
__exportStar(require("./string.util"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare enum Weekday {
|
|
2
|
+
Sunday = 0,
|
|
3
|
+
Monday = 1,
|
|
4
|
+
Tuesday = 2,
|
|
5
|
+
Wednesday = 3,
|
|
6
|
+
Thursday = 4,
|
|
7
|
+
Friday = 5,
|
|
8
|
+
Saturday = 6
|
|
9
|
+
}
|
|
10
|
+
export declare class DateCodeModel {
|
|
11
|
+
dateCode: string;
|
|
12
|
+
constructor(dateCode: string);
|
|
13
|
+
getByOffset(offset: number): DateCodeModel;
|
|
14
|
+
isValid(): boolean;
|
|
15
|
+
getDate(): Date;
|
|
16
|
+
static getRange(startDate: DateCodeModel, endDate: DateCodeModel): DateCodeModel[];
|
|
17
|
+
static fromDate(date: Date): string;
|
|
18
|
+
getFormattedDate(): string;
|
|
19
|
+
getFormattedDateWithMonthName(): string;
|
|
20
|
+
static formatDateCode(dateCode: string): string;
|
|
21
|
+
isWithinOffset(offsetInDays: number): boolean;
|
|
22
|
+
static getFinancialYearRange(dateCodeModel: DateCodeModel): {
|
|
23
|
+
startDate: DateCodeModel;
|
|
24
|
+
endDate: DateCodeModel;
|
|
25
|
+
};
|
|
26
|
+
getRange(dateCodeModel: DateCodeModel): DateCodeModel[];
|
|
27
|
+
static diffInDays(startModel: DateCodeModel, endModel: DateCodeModel, excludeDays?: Weekday[], excludeDateCodes?: DateCodeModel[]): number;
|
|
28
|
+
static getByPredicates(models: DateCodeModel[], includePredicates: ((dateModel: DateCodeModel) => boolean)[], excludePredicates: ((dateModel: DateCodeModel) => boolean)[]): DateCodeModel[];
|
|
29
|
+
static getWeekdaysPredicate(weekdays: Weekday[]): (dateModel: DateCodeModel) => boolean;
|
|
30
|
+
static getDateCodesPredicate(dateCodes: DateCodeModel[]): (dateModel: DateCodeModel) => boolean;
|
|
31
|
+
diffInDays(endModel: DateCodeModel, excludeDays?: Weekday[], excludeDateCodes?: DateCodeModel[]): number;
|
|
32
|
+
static calculateNumberOfDays(startDateCode: string, endDateCode: string): number;
|
|
33
|
+
isDayPresent(days: Weekday[]): boolean;
|
|
34
|
+
isSame(dateCodeModel: DateCodeModel): boolean;
|
|
35
|
+
getWeekday(): Weekday;
|
|
36
|
+
getDateInIST(): Date;
|
|
37
|
+
static getDaysInCurrentMonth(): number;
|
|
38
|
+
getDaysInMonth(dateCode?: string): number;
|
|
39
|
+
isPresent(dateCodes: DateCodeModel[]): boolean;
|
|
40
|
+
}
|