@zeniai/client-epic-state 5.0.2 → 5.0.3-betaND1
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/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +44 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +55 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +3 -1
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/userRole/userRoleType.d.ts +2 -2
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +49 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +4 -0
- package/lib/esm/epic.js +5 -1
- package/lib/esm/index.js +7 -0
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +149 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +72 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
- package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +52 -0
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +6 -3
- package/lib/esm/view/taskManager/taskListView/taskListPayload.js +5 -1
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +11 -0
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +27 -4
- package/lib/index.d.ts +9 -0
- package/lib/index.js +30 -3
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +31 -0
- package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.js +153 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +14 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.js +78 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +56 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +6 -3
- package/lib/view/taskManager/taskListView/taskList.d.ts +2 -0
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +10 -1
- package/lib/view/taskManager/taskListView/taskListPayload.js +7 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -1
- package/lib/view/taskManager/taskListView/taskListReducer.js +11 -0
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +4 -1
- package/lib/view/taskManager/taskListView/taskListSelector.js +27 -4
- package/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggerAiAccountantJobEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
+
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
9
|
+
const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.triggerAiAccountantJob.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
+
const { operationType, startDate, endDate } = action.payload;
|
|
11
|
+
const rootState = state$.value;
|
|
12
|
+
const selectedTenantIds = rootState.aiAccountantViewState.selectedTenantIdsForJobTrigger;
|
|
13
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
14
|
+
const url = `${base}/ai-accountant/jobs`;
|
|
15
|
+
const params = operationType === 'offboard'
|
|
16
|
+
? {}
|
|
17
|
+
: { start_date: startDate, end_date: endDate };
|
|
18
|
+
return zeniAPI
|
|
19
|
+
.postAndGetJSON(url, {
|
|
20
|
+
tenant_ids: selectedTenantIds,
|
|
21
|
+
operation_type: operationType,
|
|
22
|
+
params,
|
|
23
|
+
})
|
|
24
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
26
|
+
return (0, rxjs_1.from)([
|
|
27
|
+
(0, aiAccountantViewReducer_1.triggerAiAccountantJobSuccess)(),
|
|
28
|
+
(0, aiAccountantViewReducer_1.fetchAiAccountantCustomers)(),
|
|
29
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
30
|
+
messageSection: 'common',
|
|
31
|
+
messageText: 'success',
|
|
32
|
+
type: 'success',
|
|
33
|
+
}),
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return (0, rxjs_1.from)([
|
|
38
|
+
(0, aiAccountantViewReducer_1.triggerAiAccountantJobFailure)(response.status),
|
|
39
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
40
|
+
messageSection: 'common',
|
|
41
|
+
messageText: 'failed',
|
|
42
|
+
type: 'error',
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
47
|
+
(0, aiAccountantViewReducer_1.triggerAiAccountantJobFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant trigger job failed: ' +
|
|
48
|
+
JSON.stringify(error))),
|
|
49
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
50
|
+
messageSection: 'common',
|
|
51
|
+
messageText: 'failed',
|
|
52
|
+
type: 'error',
|
|
53
|
+
}),
|
|
54
|
+
])));
|
|
55
|
+
}));
|
|
56
|
+
exports.triggerAiAccountantJobEpic = triggerAiAccountantJobEpic;
|
|
@@ -3,16 +3,17 @@ import { ZeniDate } from '../../../zeniDayJS';
|
|
|
3
3
|
import { SubscriptionViewSortKey } from '../../subscriptionView/types/subscriptionTypes';
|
|
4
4
|
import { FilterCategoryValueType } from '../helpers/cockpitHelpers';
|
|
5
5
|
import { CockpitDownloadTabsID, CockpitTabsFileType } from './cockpitTabsID';
|
|
6
|
-
export declare const toPortfolioSortKeyType: (v: string) => "
|
|
7
|
-
export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "
|
|
8
|
-
export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "businessVerified" | "identityVerified" | "bankAccountLinked" | "customerCreated" | "groupCreated" | "qboLinked" | "
|
|
9
|
-
export declare const toHealthSortKeyType: (v: string) => "
|
|
6
|
+
export declare const toPortfolioSortKeyType: (v: string) => "companyName" | "expenses" | "runway" | "cashBalance" | "revenues" | "netIncome";
|
|
7
|
+
export declare const toManagementSortKeyType: (v: string) => "status" | "bookCloseDate" | "companyName" | "group" | "controller" | "plans" | "monthlyRecurringRevenue" | "notes" | "taxStatus" | "preparer" | "reviewer" | "annualRecurringRevenue" | "task" | "customerSuccessManager" | "apAnalyst" | "reportSent" | "taxLead" | "satisfaction";
|
|
8
|
+
export declare const toOnboardingSortKeyType: (v: string) => "companyName" | "notes" | "businessVerified" | "identityVerified" | "bankAccountLinked" | "customerCreated" | "groupCreated" | "qboLinked" | "enroller" | "invite" | "latestCreated";
|
|
9
|
+
export declare const toHealthSortKeyType: (v: string) => "companyName" | "group" | "controller" | "monthlyRecurringRevenue" | "runway" | "companyEngagementMetricsUpdatedAt" | "customerSatisfactionScore" | "externalProductServiceExposure" | "netPromoterScore" | "customerSuccessManager" | "issues" | "productVerticals" | "churnProbability" | "lastReportSent" | "subscriptionDate" | "renewalDate" | "dashboardLastSeen" | "lastEngagement";
|
|
10
10
|
export declare const toTaskManagerSortKeyType: (v: string) => "status" | "name" | "tags" | "createdBy" | "dueDate" | "priority" | "assignee" | "taskName";
|
|
11
11
|
export type PortfolioViewSortKey = ReturnType<typeof toPortfolioSortKeyType>;
|
|
12
12
|
export type ManagementViewSortKey = ReturnType<typeof toManagementSortKeyType>;
|
|
13
13
|
export type OnboardingViewSortKey = ReturnType<typeof toOnboardingSortKeyType>;
|
|
14
14
|
export type HealthViewSortKey = ReturnType<typeof toHealthSortKeyType>;
|
|
15
15
|
export type TaskManagerViewSortKey = ReturnType<typeof toTaskManagerSortKeyType>;
|
|
16
|
+
export type AiAccountantFilterCategoryField = 'enrollmentStatus';
|
|
16
17
|
export type ManagementViewFilterCategoryField = 'controllerUserIds' | 'customerSuccessManagerUserIds' | 'preparerUserIds' | 'reviewerUserIds' | 'apAnalystUserIds' | 'taxLeadUserIds' | 'companyGroupId' | 'taxStatusCode' | 'statusCode' | 'plans' | 'annualRecurringRevenue' | 'monthlyRecurringRevenue' | 'customerSatisfaction' | 'zeniSatisfaction';
|
|
17
18
|
export type SubscriptionViewFilterCategoryField = 'controllerUserIds' | 'statusCode' | 'recommendedActionCode' | 'subscriptionPlans' | 'subscriptionAddOns' | 'avg2MonthExpenses' | 'slabLowerLimit' | 'slabUpperLimit' | 'monthlyRecurringRevenue';
|
|
18
19
|
export type PortfolioViewFilterCategoryField = 'netBurnOrIncome' | 'cashPosition' | 'income' | 'expenses' | 'runway';
|
|
@@ -21,7 +22,7 @@ export interface CockpitFilterCategory {
|
|
|
21
22
|
matchingOperator: 'equal' | 'not-equal';
|
|
22
23
|
values: FilterCategoryValueType[];
|
|
23
24
|
valuesCombinationOperator: 'ANY' | 'ALL';
|
|
24
|
-
field?: ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
|
|
25
|
+
field?: AiAccountantFilterCategoryField | ManagementViewFilterCategoryField | SubscriptionViewFilterCategoryField | PortfolioViewFilterCategoryField | HealthMonitorViewFilterCategoryField;
|
|
25
26
|
}
|
|
26
27
|
export interface CockpitFilters {
|
|
27
28
|
categories?: CockpitFilterCategory[];
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLoca
|
|
|
38
38
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
39
39
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
40
40
|
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update";
|
|
41
|
-
messageText: "notification" | "
|
|
41
|
+
messageText: "notification" | "failed" | "success";
|
|
42
42
|
type: "error" | "success" | "info";
|
|
43
43
|
variables: {
|
|
44
44
|
variableName: string;
|
|
@@ -17,7 +17,7 @@ export interface MissingReceiptsViewUIState {
|
|
|
17
17
|
* Kept in sync with `ManualSearchInput` in web-components (fires search only when length ≥ this).
|
|
18
18
|
*/
|
|
19
19
|
export declare const MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = 2;
|
|
20
|
-
export declare const toBatchStatusValue: (v: string) => "pending" | "
|
|
20
|
+
export declare const toBatchStatusValue: (v: string) => "pending" | "completed" | "processing";
|
|
21
21
|
export type BatchStatusValue = ReturnType<typeof toBatchStatusValue>;
|
|
22
22
|
/** Canonical batch file statuses (API ingress may use aliases; see `parseBatchFileStatus`). */
|
|
23
23
|
export declare const BATCH_FILE_STATUSES: readonly ["exact_match", "possible_matches", "no_match", "failed"];
|
|
@@ -3,7 +3,7 @@ import { CompanyWithSchema } from '../../../../entity/company/companySelector';
|
|
|
3
3
|
import { OnboardingCustomerInfo } from '../../../../entity/onboardingCustomer/onboardingCustomerState';
|
|
4
4
|
import { Tenant } from '../../../../entity/tenant/tenantState';
|
|
5
5
|
import { CompanyDetailsLocalData, PrimaryContactLocalData } from '../../../spendManagement/commonSetup/setupViewState';
|
|
6
|
-
declare const toProductGroupType: (v: string) => "
|
|
6
|
+
declare const toProductGroupType: (v: string) => "other" | "bookkeeping" | "banking" | "spend_management" | "cards";
|
|
7
7
|
export type ProductGroupType = ReturnType<typeof toProductGroupType>;
|
|
8
8
|
export declare const toProductType: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax";
|
|
9
9
|
export declare const toProductTypeStrict: (v: string) => "zeni_treasury" | "other" | "bookkeeping" | "zeni_checking" | "zeni_bill_pay" | "zeni_reimbursements" | "zeni_cards" | "zeni_payroll" | "zeni_cfo" | "zeni_tax" | undefined;
|
|
@@ -3,7 +3,7 @@ import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
|
3
3
|
import { OnboardingInfo } from '../../entity/company/companyStateTypes';
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { AuditSummaryPayload, ReviewCompanyPayload } from './reviewCompanyPayload';
|
|
6
|
-
export declare const toReviewColumnKeyType: (v: string) => "
|
|
6
|
+
export declare const toReviewColumnKeyType: (v: string) => "companyName" | "notes" | "uncategorized" | "auditScore" | "miscategorized" | "warnings" | "vendorReview" | "reviewVendor";
|
|
7
7
|
export type ReviewCompanyColumnKey = ReturnType<typeof toReviewColumnKeyType>;
|
|
8
8
|
export type ReviewTransactionsType = 'income' | 'expense';
|
|
9
9
|
export interface AuditSummary {
|
|
@@ -21,7 +21,7 @@ export declare const fetchBillList: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
21
21
|
period: TimePeriod;
|
|
22
22
|
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
23
23
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
24
|
-
}, "billList/updateBillListFailure", never, never>, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paid" | "pending_approval" | "scheduled" | "draft", "billList/updateTab">, updateSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
24
|
+
}, "billList/updateBillListFailure", never, never>, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paid" | "pending_approval" | "scheduled" | "draft", "billList/updateTab">, updateSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"failed" | "cancelled" | "rejected" | "ach" | "wire" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline", "billList/updateSubTab">, updateSelectedBillId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "billList/updateSelectedBillId">, clearBillList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"billList/clearBillList">, updateBillDetailSaveBillCode: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<SaveBillStageCode, "billList/updateBillDetailSaveBillCode">, updateBillListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
25
|
period: TimePeriod;
|
|
26
26
|
uiState: Partial<BillListUIState>;
|
|
27
27
|
}, "billList/updateBillListUIState">, updateSearchResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "billList/updateSearchResult">, updateFilterResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -35,7 +35,7 @@ export type SaveBillStageCode = 'draft' | 'pending_approval' | undefined;
|
|
|
35
35
|
export declare const ALL_BILL_TABS: readonly ["paid", "pending_approval", "scheduled", "draft"];
|
|
36
36
|
declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "scheduled" | "draft";
|
|
37
37
|
export type BillTab = ReturnType<typeof toBillTabType>;
|
|
38
|
-
declare const toBillsSubTabType: (v: string) => "
|
|
38
|
+
declare const toBillsSubTabType: (v: string) => "failed" | "cancelled" | "rejected" | "ach" | "wire" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
|
|
39
39
|
export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
|
|
40
40
|
declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
|
|
41
41
|
export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
|
|
@@ -42,7 +42,7 @@ interface TwoFAState {
|
|
|
42
42
|
otpChallenge?: string;
|
|
43
43
|
phone?: string;
|
|
44
44
|
}
|
|
45
|
-
export declare const toChargeCardTransactionSortKeyType: (v: string) => "amount" | "type" | "
|
|
45
|
+
export declare const toChargeCardTransactionSortKeyType: (v: string) => "amount" | "type" | "merchant" | "paymentDate" | "receipts";
|
|
46
46
|
export declare type ChargeCardTransactionSortKey = ReturnType<typeof toChargeCardTransactionSortKeyType>;
|
|
47
47
|
export interface ChargeCardDetailTransactionList extends FetchStateAndError {
|
|
48
48
|
isViewReceiptClickedImmediatelyAfterUploadTransactionId: Record<ID, boolean>;
|
|
@@ -52,12 +52,12 @@ export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").Actio
|
|
|
52
52
|
chargeCardId: ID;
|
|
53
53
|
fetchState: FetchState;
|
|
54
54
|
error?: ZeniAPIStatus;
|
|
55
|
-
}, "chargeCardDetail/updatePhysicalChargeCardAttemptSuccessOrFailure">, updatePhysicalChargeCardAttempt: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, statusCode: "
|
|
55
|
+
}, "chargeCardDetail/updatePhysicalChargeCardAttemptSuccessOrFailure">, updatePhysicalChargeCardAttempt: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, statusCode: "failed" | "success"], {
|
|
56
56
|
chargeCardId: string;
|
|
57
|
-
statusCode: "
|
|
58
|
-
}, "chargeCardDetail/updatePhysicalChargeCardAttempt", never, never>, updateDebitCardPinAttempt: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, statusCode: "
|
|
57
|
+
statusCode: "failed" | "success";
|
|
58
|
+
}, "chargeCardDetail/updatePhysicalChargeCardAttempt", never, never>, updateDebitCardPinAttempt: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, statusCode: "failed" | "success"], {
|
|
59
59
|
chargeCardId: string;
|
|
60
|
-
statusCode: "
|
|
60
|
+
statusCode: "failed" | "success";
|
|
61
61
|
}, "chargeCardDetail/updateDebitCardPinAttempt", never, never>, updateDebitCardPinAttemptSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
62
62
|
chargeCardId: ID;
|
|
63
63
|
fetchState: FetchState;
|
|
@@ -27,7 +27,7 @@ export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
27
27
|
}, "remiList/updateRemiListFailure", never, never>, updateRemiListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
28
|
period: TimePeriod;
|
|
29
29
|
uiState: Partial<RemiListUIState>;
|
|
30
|
-
}, "remiList/updateRemiListUIState">, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paid" | "pending_approval" | "scheduled" | "draft", "remiList/updateTab">, updateSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"
|
|
30
|
+
}, "remiList/updateRemiListUIState">, updateTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"paid" | "pending_approval" | "scheduled" | "draft", "remiList/updateTab">, updateSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"failed" | "cancelled" | "rejected" | "ach" | "wire" | "deleted" | "overdue" | "all" | "myDrafts" | "awaitingApproval" | "awaitingMyApproval" | "awaitingAllApproval", "remiList/updateSubTab">, updateSelectedRemiId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "remiList/updateSelectedRemiId">, clearRemiList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"remiList/clearRemiList">, updateRemiDetailSaveRemiCode: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<SaveRemiStageCode, "remiList/updateRemiDetailSaveRemiCode">, updateSearchResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "remiList/updateSearchResult">, updateFilterResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
31
|
filters: ReimbursementFilters;
|
|
32
32
|
}, "remiList/updateFilterResult">, updateRemiListDownloadUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
33
33
|
uiState: Partial<RemiListDownloadUIState>;
|
|
@@ -33,10 +33,10 @@ export declare const ALL_REMI_TABS: readonly ["paid", "pending_approval", "sched
|
|
|
33
33
|
export declare const toRemiTabType: (v: string) => "paid" | "pending_approval" | "scheduled" | "draft";
|
|
34
34
|
export declare const toRemiTabTypeStrict: (v: string) => "paid" | "pending_approval" | "scheduled" | "draft" | undefined;
|
|
35
35
|
export type RemiTabType = ReturnType<typeof toRemiTabType>;
|
|
36
|
-
export declare const toRemiSubTabType: (v: string) => "
|
|
37
|
-
export declare const toRemiSubTabTypeStrict: (v: string) => "
|
|
36
|
+
export declare const toRemiSubTabType: (v: string) => "failed" | "cancelled" | "rejected" | "ach" | "wire" | "deleted" | "overdue" | "all" | "myDrafts" | "awaitingApproval" | "awaitingMyApproval" | "awaitingAllApproval";
|
|
37
|
+
export declare const toRemiSubTabTypeStrict: (v: string) => "failed" | "cancelled" | "rejected" | "ach" | "wire" | "deleted" | "overdue" | "all" | "myDrafts" | "awaitingApproval" | "awaitingMyApproval" | "awaitingAllApproval" | undefined;
|
|
38
38
|
export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
|
|
39
|
-
export declare const toRemiSubTabUnderScoreType: (v: string) => "
|
|
39
|
+
export declare const toRemiSubTabUnderScoreType: (v: string) => "failed" | "cancelled" | "rejected" | "ach" | "wire" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
|
|
40
40
|
export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
|
|
41
41
|
declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "createdBy" | "submittedOn" | "reportName";
|
|
42
42
|
export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const toSubscriptionSortKeyType: (v: string) => "status" | "
|
|
1
|
+
export declare const toSubscriptionSortKeyType: (v: string) => "status" | "companyName" | "controller" | "plans" | "planLowerLimit" | "planHigherLimit" | "avg2MonthExpenses" | "addons" | "upgradeStatus" | "monthlyRecurringRevenue" | "notes";
|
|
2
2
|
export type SubscriptionViewSortKey = ReturnType<typeof toSubscriptionSortKeyType>;
|
|
3
3
|
export declare const SUBSCRIPTION_STATUS_CODES: string[];
|
|
4
4
|
declare const toSubscriptionStatusCodeType: (v: string) => string;
|
|
@@ -6,16 +6,19 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const tagReducer_1 = require("../../../../entity/tag/tagReducer");
|
|
7
7
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
8
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
+
const taskListPayload_1 = require("../taskListPayload");
|
|
9
10
|
const taskListReducer_1 = require("../taskListReducer");
|
|
10
11
|
const fetchTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.fetchTaskList.match), (0, operators_1.switchMap)(() => {
|
|
11
12
|
return zeniAPI
|
|
12
13
|
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks?query=${encodeURIComponent(`{"task_type": "all"}`)}`)
|
|
13
14
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
15
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const { tasks } = response.data;
|
|
17
|
+
const tasksForEntity = (0, taskListPayload_1.flattenTasksAndSubtasksForEntity)(tasks);
|
|
18
|
+
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(tasksForEntity), (0, taskListReducer_1.updateTaskList)({
|
|
19
|
+
data: tasks,
|
|
17
20
|
updateType: 'replace',
|
|
18
|
-
}), (0, tagReducer_1.updateTags)(
|
|
21
|
+
}), (0, tagReducer_1.updateTags)(tasksForEntity.map((task) => task.tags).flat()));
|
|
19
22
|
}
|
|
20
23
|
else {
|
|
21
24
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTaskListFetchStatus)({
|
|
@@ -15,6 +15,8 @@ export declare type DueDateGroupKey = ReturnType<typeof toDueDateGroupKeyType>;
|
|
|
15
15
|
export interface TaskListState extends FetchedState {
|
|
16
16
|
filters: TaskListFilters;
|
|
17
17
|
localData: TaskListLocalData;
|
|
18
|
+
/** Maps each list (parent) task id to ordered subtask ids from the last list fetch. */
|
|
19
|
+
subtaskIdsByParentTaskId: Record<ID, ID[]>;
|
|
18
20
|
taskIds: ID[];
|
|
19
21
|
taskIdsByAssignees: Record<ID, ID[]>;
|
|
20
22
|
taskIdsByDueDate: Record<DueDateGroupKey, ID[]>;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { TaskPayload } from '../../../entity/task/taskPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
|
+
/**
|
|
4
|
+
* Task row returned by the task list API. Subtasks share the same wire shape
|
|
5
|
+
* as tasks but are nested under their parent and indexed separately in list state.
|
|
6
|
+
*/
|
|
7
|
+
export interface TaskListTaskPayload extends TaskPayload {
|
|
8
|
+
subtasks?: TaskPayload[];
|
|
9
|
+
}
|
|
3
10
|
interface FetchTaskListPayload {
|
|
4
|
-
tasks:
|
|
11
|
+
tasks: TaskListTaskPayload[];
|
|
5
12
|
}
|
|
6
13
|
export type FetchTaskListResponse = ZeniAPIResponse<FetchTaskListPayload>;
|
|
14
|
+
/** Parent tasks and nested subtasks as flat `TaskPayload`s for `updateTasks`. */
|
|
15
|
+
export declare const flattenTasksAndSubtasksForEntity: (tasks: TaskListTaskPayload[]) => TaskPayload[];
|
|
7
16
|
export {};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flattenTasksAndSubtasksForEntity = void 0;
|
|
4
|
+
/** Parent tasks and nested subtasks as flat `TaskPayload`s for `updateTasks`. */
|
|
5
|
+
const flattenTasksAndSubtasksForEntity = (tasks) => tasks.flatMap((task) => {
|
|
6
|
+
const { subtasks, ...parent } = task;
|
|
7
|
+
return [parent, ...(subtasks ?? [])];
|
|
8
|
+
});
|
|
9
|
+
exports.flattenTasksAndSubtasksForEntity = flattenTasksAndSubtasksForEntity;
|
|
@@ -5,12 +5,13 @@ import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
|
5
5
|
import { TaskGroup } from '../../../entity/taskGroup/taskGroupState';
|
|
6
6
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
7
7
|
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListUIState } from './taskList';
|
|
8
|
+
import { TaskListTaskPayload } from './taskListPayload';
|
|
8
9
|
export declare const initialState: TaskListState;
|
|
9
10
|
export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, isTaskTemplatesEnabled: boolean], {
|
|
10
11
|
cacheOverride: boolean;
|
|
11
12
|
isTaskTemplatesEnabled: boolean;
|
|
12
13
|
}, "taskList/fetchTaskListPage", never, never>, fetchTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/fetchTaskList">, updateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
-
data:
|
|
14
|
+
data: TaskListTaskPayload[];
|
|
14
15
|
updateType: UpdateType;
|
|
15
16
|
}, "taskList/updateTaskList">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
17
|
fetchState: FetchState;
|
|
@@ -34,6 +34,7 @@ const initialTaskIdsByDueDate = {
|
|
|
34
34
|
upcoming: [],
|
|
35
35
|
};
|
|
36
36
|
exports.initialState = {
|
|
37
|
+
subtaskIdsByParentTaskId: {},
|
|
37
38
|
taskIds: [],
|
|
38
39
|
taskIdsByGroupsIds: {},
|
|
39
40
|
taskIdsByPriority: initialTaskIdsByPriority,
|
|
@@ -93,6 +94,7 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
93
94
|
const { data } = action.payload;
|
|
94
95
|
draft.fetchState = 'Completed';
|
|
95
96
|
draft.error = undefined;
|
|
97
|
+
draft.subtaskIdsByParentTaskId = buildSubtaskIdsByParentTaskId(data);
|
|
96
98
|
const { taskIds, taskIdsGroupedByPriority, taskIdsByGroupIds, taskIdsGroupedByStatus, taskIdsByAssignees, taskIdsByDueDate, taskIdsByTags, } = getGroupedTaskIds(data);
|
|
97
99
|
draft.taskIds = taskIds;
|
|
98
100
|
draft.taskIdsByGroupsIds = taskIdsByGroupIds;
|
|
@@ -492,6 +494,15 @@ const getTagsGroupKey = (tags) => {
|
|
|
492
494
|
tagIds.sort();
|
|
493
495
|
return tagIds.join(',');
|
|
494
496
|
};
|
|
497
|
+
const buildSubtaskIdsByParentTaskId = (tasks) => {
|
|
498
|
+
const subtaskIdsByParentTaskId = {};
|
|
499
|
+
tasks.forEach((task) => {
|
|
500
|
+
if (task.subtasks != null && task.subtasks.length > 0) {
|
|
501
|
+
subtaskIdsByParentTaskId[task.task_id] = task.subtasks.map((s) => s.task_id);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
return subtaskIdsByParentTaskId;
|
|
505
|
+
};
|
|
495
506
|
const getGroupedTaskIds = (tasks) => {
|
|
496
507
|
const taskIds = [];
|
|
497
508
|
const taskIdsByGroupIds = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { AddressState } from '../../../entity/address/addressState';
|
|
4
4
|
import { TagState } from '../../../entity/tag/tagState';
|
|
@@ -13,6 +13,7 @@ import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
|
13
13
|
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListUIState } from './taskList';
|
|
14
14
|
export interface TaskWithUserDetails extends Task {
|
|
15
15
|
assigneeUsers: UserAndRole[];
|
|
16
|
+
subtasks: TaskWithUserDetails[];
|
|
16
17
|
}
|
|
17
18
|
export interface TaskGroupWithTasksList {
|
|
18
19
|
groupName: string;
|
|
@@ -23,6 +24,8 @@ export interface TaskGroupWithTasksList {
|
|
|
23
24
|
export interface TaskListSelectorView extends SelectorView {
|
|
24
25
|
filters: TaskListFilters;
|
|
25
26
|
localData: TaskListLocalData;
|
|
27
|
+
/** Subtask ids grouped by parent list task id (from the task list API). */
|
|
28
|
+
subtaskIdsByParentTaskId: Record<ID, ID[]>;
|
|
26
29
|
taskCreationFromTemplateStatus: FetchStateAndError;
|
|
27
30
|
taskGroupCreationStatus: FetchStateAndError;
|
|
28
31
|
taskGroupDeleteStatus: FetchStateAndError;
|
|
@@ -49,6 +49,30 @@ const sortTasksList = (tagState, tasksList, sortKey, sortOrder) => {
|
|
|
49
49
|
}, sortOrder);
|
|
50
50
|
return tasksInOrder;
|
|
51
51
|
};
|
|
52
|
+
const taskToTaskWithUserDetails = (task, userState, userRoleState, addressState) => ({
|
|
53
|
+
...task,
|
|
54
|
+
assigneeUsers: task.assignees
|
|
55
|
+
.map((userId) => (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, userId))
|
|
56
|
+
.filter((value) => value != null),
|
|
57
|
+
subtasks: [],
|
|
58
|
+
});
|
|
59
|
+
const attachSubtasksForTask = (taskWithAssignees, taskListState, taskState, userState, userRoleState, addressState) => {
|
|
60
|
+
const subtaskIds = taskListState.subtaskIdsByParentTaskId[taskWithAssignees.id] ?? [];
|
|
61
|
+
if (subtaskIds.length === 0) {
|
|
62
|
+
return { ...taskWithAssignees, subtasks: [] };
|
|
63
|
+
}
|
|
64
|
+
const subtasks = subtaskIds
|
|
65
|
+
.map((subtaskId) => {
|
|
66
|
+
const subtask = (0, taskSelector_1.getTaskById)(taskState, subtaskId);
|
|
67
|
+
if (subtask == null) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const withAssignees = taskToTaskWithUserDetails(subtask, userState, userRoleState, addressState);
|
|
71
|
+
return attachSubtasksForTask(withAssignees, taskListState, taskState, userState, userRoleState, addressState);
|
|
72
|
+
})
|
|
73
|
+
.filter((value) => value != null);
|
|
74
|
+
return { ...taskWithAssignees, subtasks };
|
|
75
|
+
};
|
|
52
76
|
const getTasksWithUserDetails = ({ taskListState, taskState, userState, userRoleState, addressState, taskIds, tagState, }) => {
|
|
53
77
|
const { sortKey, searchText } = taskListState.uiState;
|
|
54
78
|
const sortOrder = (0, sortOrderPayload_1.getSortOrder)(taskListState.uiState.sortOrder);
|
|
@@ -56,10 +80,8 @@ const getTasksWithUserDetails = ({ taskListState, taskState, userState, userRole
|
|
|
56
80
|
.map((taskId) => {
|
|
57
81
|
const task = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
58
82
|
if (task != null) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
.filter((value) => value != null);
|
|
62
|
-
return { ...task, assigneeUsers };
|
|
83
|
+
const taskWithAssignees = taskToTaskWithUserDetails(task, userState, userRoleState, addressState);
|
|
84
|
+
return attachSubtasksForTask(taskWithAssignees, taskListState, taskState, userState, userRoleState, addressState);
|
|
63
85
|
}
|
|
64
86
|
return undefined;
|
|
65
87
|
})
|
|
@@ -342,6 +364,7 @@ exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListSta
|
|
|
342
364
|
return {
|
|
343
365
|
uiState: taskListState.uiState,
|
|
344
366
|
filters: taskListState.filters,
|
|
367
|
+
subtaskIdsByParentTaskId: taskListState.subtaskIdsByParentTaskId,
|
|
345
368
|
taskGroupTemplates,
|
|
346
369
|
fetchState: fetchState,
|
|
347
370
|
userList: (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'taskManagerCandidate'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3-betaND1",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|