@zeniai/client-epic-state 5.0.55-betaAR6 → 5.0.55-betaML3
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/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/entity/account/accountSelector.d.ts +6 -20
- package/lib/entity/account/accountSelector.js +8 -35
- package/lib/entity/account/accountState.d.ts +1 -6
- package/lib/entity/account/accountState.js +4 -11
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classSelector.d.ts +0 -5
- package/lib/entity/class/classSelector.js +0 -8
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/esm/entity/account/accountSelector.js +7 -33
- package/lib/esm/entity/account/accountState.js +1 -7
- package/lib/esm/entity/class/classSelector.js +0 -7
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +6 -12
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +81 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +5 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +25 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +66 -11
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +27 -58
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +0 -2
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +13 -2
- package/lib/index.d.ts +7 -9
- package/lib/index.js +42 -41
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +85 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +4 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +29 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +16 -6
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +67 -12
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +3 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +3 -4
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +28 -60
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +13 -3
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +0 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +2 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +4 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +12 -1
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +0 -186
- package/lib/view/expenseAutomationView/transactionFilterHelpers.d.ts +0 -64
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +0 -190
|
@@ -3,8 +3,8 @@ import { FetchStateAndError, ID } from '../common';
|
|
|
3
3
|
import { DataAvailable } from '../dataAvailable';
|
|
4
4
|
import { Status } from '../status';
|
|
5
5
|
import { Month } from '../timePeriod';
|
|
6
|
-
export declare const ALL_REPORT_IDS: readonly ["cash_balance", "card_balance", "expense_automation_card", "operating_expenses", "operating_expenses_by_classes", "revenue", "revenue_by_classes", "net_burn_or_income", "net_burn_or_income_story_card", "net_burn_or_income_by_classes", "cash_position", "top_expenses", "profit_and_loss", "profit_and_loss_by_classes", "profit_and_loss_by_projects", "balance_sheet", "cash_flow", "dashboard", "finance_statement", "transaction_list_of_account", "transaction_list_missing_receipt", "transaction_list_of_account_by_class", "transaction_list_of_account_by_project", "transaction_detail", "cash_in_cash_out", "insights_dashboard", "company_details", "class_list", "account_list", "account_list_by_type", "vendor", "task_card", "bill_pay", "reimbursement", "bill_pay_card", "reimbursement_card", "bill_pay_promo_card", "zeni_accounts", "zeni_accounts_promo_card", "zeni_treasury", "charge_cards", "other_connection", "reimbursement_promo_card", "onboarding", "operating_expenses_by_vendor", "operating_expenses_by_vendor_summary", "vendors_tab", "accounts_payable_aging", "accounts_receivable_aging", "vendor_global_review", "prepaid_expenses", "fixed_assets", "notification", "rewards_card", "billing", "flux_analysis_operating_expense", "account_reconciliation", "zeni_credit_promo_card", "treasury_promo_card", "excluded_account_reconciliation"];
|
|
7
|
-
export declare const toReportID: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
6
|
+
export declare const ALL_REPORT_IDS: readonly ["cash_balance", "card_balance", "expense_automation_card", "operating_expenses", "operating_expenses_by_classes", "revenue", "revenue_by_classes", "net_burn_or_income", "net_burn_or_income_story_card", "net_burn_or_income_by_classes", "cash_position", "top_expenses", "profit_and_loss", "profit_and_loss_by_classes", "profit_and_loss_by_projects", "balance_sheet", "cash_flow", "dashboard", "finance_statement", "transaction_list_of_account", "transaction_list_missing_receipt", "transaction_list_of_account_by_class", "transaction_list_of_account_by_project", "transaction_detail", "cash_in_cash_out", "insights_dashboard", "company_details", "class_list", "account_list", "account_list_by_type", "vendor", "task_card", "bill_pay", "reimbursement", "bill_pay_card", "reimbursement_card", "bill_pay_promo_card", "zeni_accounts", "zeni_accounts_promo_card", "zeni_treasury", "charge_cards", "other_connection", "reimbursement_promo_card", "onboarding", "operating_expenses_by_vendor", "operating_expenses_by_vendor_summary", "vendors_tab", "accounts_payable_aging", "accounts_receivable_aging", "vendor_global_review", "prepaid_expenses", "fixed_assets", "notification", "rewards_card", "billing", "flux_analysis_operating_expense", "account_reconciliation", "zeni_credit_promo_card", "treasury_promo_card", "excluded_account_reconciliation", "transfer_accounts"];
|
|
7
|
+
export declare const toReportID: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts";
|
|
8
8
|
export type ReportID = ReturnType<typeof toReportID>;
|
|
9
9
|
export type ReportIDPlusForecastID = ReportID | `${ReportID}+${ID}`;
|
|
10
10
|
/** Any view state should extend this interface */
|
|
@@ -63,6 +63,7 @@ exports.ALL_REPORT_IDS = [
|
|
|
63
63
|
'zeni_credit_promo_card',
|
|
64
64
|
'treasury_promo_card',
|
|
65
65
|
'excluded_account_reconciliation',
|
|
66
|
+
'transfer_accounts',
|
|
66
67
|
];
|
|
67
68
|
const toReportID = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_REPORT_IDS);
|
|
68
69
|
exports.toReportID = toReportID;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { AccountsViewParentID } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { ClassesViewParentID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
+
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
3
4
|
import { AdditionalBalancesOptions } from '../../commonStateTypes/coaBalance/additionalBalances/getAdditionalBalances';
|
|
4
5
|
import { COABalancesFilter } from '../../commonStateTypes/coaBalance/coaBalancesFilter';
|
|
5
6
|
import { ID } from '../../commonStateTypes/common';
|
|
6
|
-
import { ProjectsViewParentID } from '../../commonStateTypes/projectView/projectViewParentID';
|
|
7
7
|
import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes';
|
|
8
8
|
import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
9
9
|
import { Account, AccountBase, AccountState, AccountType } from './accountState';
|
|
10
10
|
export declare const getAccountBase: (accountState: AccountState, accountId: ID, reportId: ReportIDPlusForecastID) => AccountBase | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Transfer-account IDs from the API are resolved under `transfer_accounts`; if that
|
|
13
|
+
* slice is not hydrated yet, fall back to `account_list` so dropdowns still populate.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getAccountBaseForTransferAccounts: (accountState: AccountState, accountId: ID) => AccountBase | undefined;
|
|
11
16
|
export declare function getAccount(accountState: AccountState, id: {
|
|
12
17
|
accountId: ID;
|
|
13
18
|
reportId: ReportIDPlusForecastID;
|
|
@@ -123,22 +128,3 @@ export declare const getAccountsOrdered: (filter: COABalancesFilter, accountStat
|
|
|
123
128
|
export declare const getAccountsByType: (accountState: AccountState, accountTypes: AccountType[]) => Partial<Record<AccountType, Account[]>>;
|
|
124
129
|
export declare const getAccountIdsForTypes: (accountState: AccountState, accountTypes: AccountType[]) => ID[];
|
|
125
130
|
export declare const getAccountIdsForLabels: (accountState: AccountState, labels: string[]) => ID[];
|
|
126
|
-
/**
|
|
127
|
-
* Returns all accounts currently in state (single pass over accountsByKey).
|
|
128
|
-
* Use for dropdowns that need account names and types; map to
|
|
129
|
-
* { accountId, accountName, accountType } as needed.
|
|
130
|
-
*/
|
|
131
|
-
export declare const getAllAccounts: (accountState: AccountState) => Account[];
|
|
132
|
-
export interface AccountFilterOption {
|
|
133
|
-
accountId: ID;
|
|
134
|
-
accountName: string;
|
|
135
|
-
accountType: AccountType;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
|
|
139
|
-
* all other account types → categoryOptions. Use for payment_account_name and category filter options.
|
|
140
|
-
*/
|
|
141
|
-
export declare const getTransactionFilterAccountOptions: (accountState: AccountState) => {
|
|
142
|
-
categoryOptions: AccountFilterOption[];
|
|
143
|
-
paymentAccountNames: AccountFilterOption[];
|
|
144
|
-
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getAccountIdsForLabels = exports.getAccountIdsForTypes = exports.getAccountsByType = exports.getAccountsOrdered = exports.getAccountBaseForTransferAccounts = exports.getAccountBase = void 0;
|
|
7
7
|
exports.getAccount = getAccount;
|
|
8
8
|
exports.getAccountWithBalance = getAccountWithBalance;
|
|
9
9
|
const flatMap_1 = __importDefault(require("lodash/flatMap"));
|
|
@@ -59,6 +59,13 @@ const getAccountBase = (accountState, accountId, reportId) => {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
exports.getAccountBase = getAccountBase;
|
|
62
|
+
/**
|
|
63
|
+
* Transfer-account IDs from the API are resolved under `transfer_accounts`; if that
|
|
64
|
+
* slice is not hydrated yet, fall back to `account_list` so dropdowns still populate.
|
|
65
|
+
*/
|
|
66
|
+
const getAccountBaseForTransferAccounts = (accountState, accountId) => (0, exports.getAccountBase)(accountState, accountId, 'transfer_accounts') ??
|
|
67
|
+
(0, exports.getAccountBase)(accountState, accountId, 'account_list');
|
|
68
|
+
exports.getAccountBaseForTransferAccounts = getAccountBaseForTransferAccounts;
|
|
62
69
|
function getAccount(accountState, id, filter, additionalBalancesOptions) {
|
|
63
70
|
const key = (0, accountState_1.getAccountKey)(id.reportId, id.accountId, id.classesViewParentId, id.accountsViewParentId, id.projectsViewParentId);
|
|
64
71
|
const account = accountState.accountsByKey[key];
|
|
@@ -192,37 +199,3 @@ const getAccountIdsForLabels = (accountState, labels) => {
|
|
|
192
199
|
return allAccountIdsForLabels;
|
|
193
200
|
};
|
|
194
201
|
exports.getAccountIdsForLabels = getAccountIdsForLabels;
|
|
195
|
-
/**
|
|
196
|
-
* Returns all accounts currently in state (single pass over accountsByKey).
|
|
197
|
-
* Use for dropdowns that need account names and types; map to
|
|
198
|
-
* { accountId, accountName, accountType } as needed.
|
|
199
|
-
*/
|
|
200
|
-
const getAllAccounts = (accountState) => Object.values(accountState.accountsByKey);
|
|
201
|
-
exports.getAllAccounts = getAllAccounts;
|
|
202
|
-
/**
|
|
203
|
-
* Partitions accounts for transaction filter dropdowns: bank/credit_card → paymentAccountNames,
|
|
204
|
-
* all other account types → categoryOptions. Use for payment_account_name and category filter options.
|
|
205
|
-
*/
|
|
206
|
-
const getTransactionFilterAccountOptions = (accountState) => {
|
|
207
|
-
const accounts = (0, exports.getAllAccounts)(accountState);
|
|
208
|
-
const paymentAccountNames = [];
|
|
209
|
-
const categoryOptions = [];
|
|
210
|
-
for (const account of accounts) {
|
|
211
|
-
if (account.accountType == null) {
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
const option = {
|
|
215
|
-
accountId: account.accountId,
|
|
216
|
-
accountName: account.accountName,
|
|
217
|
-
accountType: account.accountType,
|
|
218
|
-
};
|
|
219
|
-
if ((0, accountState_1.isPaymentAccountType)(account.accountType)) {
|
|
220
|
-
paymentAccountNames.push(option);
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
categoryOptions.push(option);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return { categoryOptions, paymentAccountNames };
|
|
227
|
-
};
|
|
228
|
-
exports.getTransactionFilterAccountOptions = getTransactionFilterAccountOptions;
|
|
@@ -8,19 +8,14 @@ import { RecommendationBase } from '../../commonStateTypes/recommendationBase';
|
|
|
8
8
|
import { Status } from '../../commonStateTypes/status';
|
|
9
9
|
import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
10
10
|
import { ZeniUrl } from '../../zeniUrl';
|
|
11
|
-
export declare const ALL_ACCOUNT_TYPES: readonly ["bank", "credit_card", "expenses", "cogs", "income", "cash_in", "cash_out", "cash_position", "other_income", "other_expense", "accounts_receivable", "other_current_assets", "fixed_assets", "other_assets", "accounts_payable", "other_current_liabilities", "long_term_liabilities", "equity", "current_liabilities", "current_assets"];
|
|
12
11
|
export declare const toAccountType: (v: string) => "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets";
|
|
13
12
|
export type AccountType = ReturnType<typeof toAccountType>;
|
|
14
13
|
export declare const toAccountTypeStrict: (v: string | null | undefined) => AccountType | undefined;
|
|
15
|
-
/** Account types used for payment-account filters (e.g. transaction filter "payment account name"). */
|
|
16
|
-
export declare const PAYMENT_ACCOUNT_TYPES: readonly ["bank", "credit_card"];
|
|
17
|
-
export type PaymentAccountType = (typeof PAYMENT_ACCOUNT_TYPES)[number];
|
|
18
|
-
export declare function isPaymentAccountType(accountType: AccountType | undefined): accountType is PaymentAccountType;
|
|
19
14
|
export type UncategorizedAccountTypes = 'expense' | 'income';
|
|
20
15
|
declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses";
|
|
21
16
|
export type AccountLabel = ReturnType<typeof toAccountLabel>;
|
|
22
17
|
export declare const toAccountLabelStrict: (v: string | null | undefined) => AccountLabel | undefined;
|
|
23
|
-
export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID, projectsViewParentId?: ProjectsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${string}-expense_automation_card` | `${string}-operating_expenses` | `${string}-operating_expenses_by_classes` | `${string}-revenue` | `${string}-revenue_by_classes` | `${string}-net_burn_or_income` | `${string}-net_burn_or_income_story_card` | `${string}-net_burn_or_income_by_classes` | `${string}-cash_position` | `${string}-top_expenses` | `${string}-profit_and_loss` | `${string}-profit_and_loss_by_classes` | `${string}-profit_and_loss_by_projects` | `${string}-balance_sheet` | `${string}-cash_flow` | `${string}-dashboard` | `${string}-finance_statement` | `${string}-transaction_list_of_account` | `${string}-transaction_list_missing_receipt` | `${string}-transaction_list_of_account_by_class` | `${string}-transaction_list_of_account_by_project` | `${string}-transaction_detail` | `${string}-cash_in_cash_out` | `${string}-insights_dashboard` | `${string}-company_details` | `${string}-class_list` | `${string}-account_list` | `${string}-account_list_by_type` | `${string}-vendor` | `${string}-task_card` | `${string}-bill_pay` | `${string}-reimbursement` | `${string}-bill_pay_card` | `${string}-reimbursement_card` | `${string}-bill_pay_promo_card` | `${string}-zeni_accounts` | `${string}-zeni_accounts_promo_card` | `${string}-zeni_treasury` | `${string}-charge_cards` | `${string}-other_connection` | `${string}-reimbursement_promo_card` | `${string}-onboarding` | `${string}-operating_expenses_by_vendor` | `${string}-operating_expenses_by_vendor_summary` | `${string}-vendors_tab` | `${string}-accounts_payable_aging` | `${string}-accounts_receivable_aging` | `${string}-vendor_global_review` | `${string}-prepaid_expenses` | `${string}-fixed_assets` | `${string}-notification` | `${string}-rewards_card` | `${string}-billing` | `${string}-flux_analysis_operating_expense` | `${string}-account_reconciliation` | `${string}-zeni_credit_promo_card` | `${string}-treasury_promo_card` | `${string}-excluded_account_reconciliation` | `${string}-cash_balance+${string}` | `${string}-card_balance+${string}` | `${string}-expense_automation_card+${string}` | `${string}-operating_expenses+${string}` | `${string}-operating_expenses_by_classes+${string}` | `${string}-revenue+${string}` | `${string}-revenue_by_classes+${string}` | `${string}-net_burn_or_income+${string}` | `${string}-net_burn_or_income_story_card+${string}` | `${string}-net_burn_or_income_by_classes+${string}` | `${string}-cash_position+${string}` | `${string}-top_expenses+${string}` | `${string}-profit_and_loss+${string}` | `${string}-profit_and_loss_by_classes+${string}` | `${string}-profit_and_loss_by_projects+${string}` | `${string}-balance_sheet+${string}` | `${string}-cash_flow+${string}` | `${string}-dashboard+${string}` | `${string}-finance_statement+${string}` | `${string}-transaction_list_of_account+${string}` | `${string}-transaction_list_missing_receipt+${string}` | `${string}-transaction_list_of_account_by_class+${string}` | `${string}-transaction_list_of_account_by_project+${string}` | `${string}-transaction_detail+${string}` | `${string}-cash_in_cash_out+${string}` | `${string}-insights_dashboard+${string}` | `${string}-company_details+${string}` | `${string}-class_list+${string}` | `${string}-account_list+${string}` | `${string}-account_list_by_type+${string}` | `${string}-vendor+${string}` | `${string}-task_card+${string}` | `${string}-bill_pay+${string}` | `${string}-reimbursement+${string}` | `${string}-bill_pay_card+${string}` | `${string}-reimbursement_card+${string}` | `${string}-bill_pay_promo_card+${string}` | `${string}-zeni_accounts+${string}` | `${string}-zeni_accounts_promo_card+${string}` | `${string}-zeni_treasury+${string}` | `${string}-charge_cards+${string}` | `${string}-other_connection+${string}` | `${string}-reimbursement_promo_card+${string}` | `${string}-onboarding+${string}` | `${string}-operating_expenses_by_vendor+${string}` | `${string}-operating_expenses_by_vendor_summary+${string}` | `${string}-vendors_tab+${string}` | `${string}-accounts_payable_aging+${string}` | `${string}-accounts_receivable_aging+${string}` | `${string}-vendor_global_review+${string}` | `${string}-prepaid_expenses+${string}` | `${string}-fixed_assets+${string}` | `${string}-notification+${string}` | `${string}-rewards_card+${string}` | `${string}-billing+${string}` | `${string}-flux_analysis_operating_expense+${string}` | `${string}-account_reconciliation+${string}` | `${string}-zeni_credit_promo_card+${string}` | `${string}-treasury_promo_card+${string}` | `${string}-excluded_account_reconciliation+${string}`;
|
|
18
|
+
export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID, projectsViewParentId?: ProjectsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${string}-expense_automation_card` | `${string}-operating_expenses` | `${string}-operating_expenses_by_classes` | `${string}-revenue` | `${string}-revenue_by_classes` | `${string}-net_burn_or_income` | `${string}-net_burn_or_income_story_card` | `${string}-net_burn_or_income_by_classes` | `${string}-cash_position` | `${string}-top_expenses` | `${string}-profit_and_loss` | `${string}-profit_and_loss_by_classes` | `${string}-profit_and_loss_by_projects` | `${string}-balance_sheet` | `${string}-cash_flow` | `${string}-dashboard` | `${string}-finance_statement` | `${string}-transaction_list_of_account` | `${string}-transaction_list_missing_receipt` | `${string}-transaction_list_of_account_by_class` | `${string}-transaction_list_of_account_by_project` | `${string}-transaction_detail` | `${string}-cash_in_cash_out` | `${string}-insights_dashboard` | `${string}-company_details` | `${string}-class_list` | `${string}-account_list` | `${string}-account_list_by_type` | `${string}-vendor` | `${string}-task_card` | `${string}-bill_pay` | `${string}-reimbursement` | `${string}-bill_pay_card` | `${string}-reimbursement_card` | `${string}-bill_pay_promo_card` | `${string}-zeni_accounts` | `${string}-zeni_accounts_promo_card` | `${string}-zeni_treasury` | `${string}-charge_cards` | `${string}-other_connection` | `${string}-reimbursement_promo_card` | `${string}-onboarding` | `${string}-operating_expenses_by_vendor` | `${string}-operating_expenses_by_vendor_summary` | `${string}-vendors_tab` | `${string}-accounts_payable_aging` | `${string}-accounts_receivable_aging` | `${string}-vendor_global_review` | `${string}-prepaid_expenses` | `${string}-fixed_assets` | `${string}-notification` | `${string}-rewards_card` | `${string}-billing` | `${string}-flux_analysis_operating_expense` | `${string}-account_reconciliation` | `${string}-zeni_credit_promo_card` | `${string}-treasury_promo_card` | `${string}-excluded_account_reconciliation` | `${string}-transfer_accounts` | `${string}-cash_balance+${string}` | `${string}-card_balance+${string}` | `${string}-expense_automation_card+${string}` | `${string}-operating_expenses+${string}` | `${string}-operating_expenses_by_classes+${string}` | `${string}-revenue+${string}` | `${string}-revenue_by_classes+${string}` | `${string}-net_burn_or_income+${string}` | `${string}-net_burn_or_income_story_card+${string}` | `${string}-net_burn_or_income_by_classes+${string}` | `${string}-cash_position+${string}` | `${string}-top_expenses+${string}` | `${string}-profit_and_loss+${string}` | `${string}-profit_and_loss_by_classes+${string}` | `${string}-profit_and_loss_by_projects+${string}` | `${string}-balance_sheet+${string}` | `${string}-cash_flow+${string}` | `${string}-dashboard+${string}` | `${string}-finance_statement+${string}` | `${string}-transaction_list_of_account+${string}` | `${string}-transaction_list_missing_receipt+${string}` | `${string}-transaction_list_of_account_by_class+${string}` | `${string}-transaction_list_of_account_by_project+${string}` | `${string}-transaction_detail+${string}` | `${string}-cash_in_cash_out+${string}` | `${string}-insights_dashboard+${string}` | `${string}-company_details+${string}` | `${string}-class_list+${string}` | `${string}-account_list+${string}` | `${string}-account_list_by_type+${string}` | `${string}-vendor+${string}` | `${string}-task_card+${string}` | `${string}-bill_pay+${string}` | `${string}-reimbursement+${string}` | `${string}-bill_pay_card+${string}` | `${string}-reimbursement_card+${string}` | `${string}-bill_pay_promo_card+${string}` | `${string}-zeni_accounts+${string}` | `${string}-zeni_accounts_promo_card+${string}` | `${string}-zeni_treasury+${string}` | `${string}-charge_cards+${string}` | `${string}-other_connection+${string}` | `${string}-reimbursement_promo_card+${string}` | `${string}-onboarding+${string}` | `${string}-operating_expenses_by_vendor+${string}` | `${string}-operating_expenses_by_vendor_summary+${string}` | `${string}-vendors_tab+${string}` | `${string}-accounts_payable_aging+${string}` | `${string}-accounts_receivable_aging+${string}` | `${string}-vendor_global_review+${string}` | `${string}-prepaid_expenses+${string}` | `${string}-fixed_assets+${string}` | `${string}-notification+${string}` | `${string}-rewards_card+${string}` | `${string}-billing+${string}` | `${string}-flux_analysis_operating_expense+${string}` | `${string}-account_reconciliation+${string}` | `${string}-zeni_credit_promo_card+${string}` | `${string}-treasury_promo_card+${string}` | `${string}-excluded_account_reconciliation+${string}` | `${string}-transfer_accounts+${string}`;
|
|
24
19
|
export type AccountKey = ReturnType<typeof getAccountKey>;
|
|
25
20
|
export declare const toReconciliationAccountSource: (v: string) => "plaid" | "bank_statement";
|
|
26
21
|
export type ReconciliationAccountSourceType = ReturnType<typeof toReconciliationAccountSource>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toReconciliationAccountSourceStrict = exports.toReconciliationAccountSource = exports.toAccountLabelStrict = exports.
|
|
4
|
-
exports.isPaymentAccountType = isPaymentAccountType;
|
|
3
|
+
exports.toReconciliationAccountSourceStrict = exports.toReconciliationAccountSource = exports.toAccountLabelStrict = exports.toAccountTypeStrict = exports.toAccountType = void 0;
|
|
5
4
|
exports.getAccountKey = getAccountKey;
|
|
6
5
|
const nestedAccountID_1 = require("../../commonStateTypes/accountView/nestedAccountID");
|
|
7
6
|
const nestedClassID_1 = require("../../commonStateTypes/classesView/nestedClassID");
|
|
8
7
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
9
|
-
|
|
8
|
+
const ALL_ACCOUNT_TYPES = [
|
|
10
9
|
'bank',
|
|
11
10
|
'credit_card',
|
|
12
11
|
'expenses',
|
|
@@ -28,16 +27,10 @@ exports.ALL_ACCOUNT_TYPES = [
|
|
|
28
27
|
'current_liabilities',
|
|
29
28
|
'current_assets',
|
|
30
29
|
];
|
|
31
|
-
const toAccountType = (v) => (0, stringToUnion_1.stringToUnion)(v,
|
|
30
|
+
const toAccountType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_ACCOUNT_TYPES);
|
|
32
31
|
exports.toAccountType = toAccountType;
|
|
33
|
-
const toAccountTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '',
|
|
32
|
+
const toAccountTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ALL_ACCOUNT_TYPES);
|
|
34
33
|
exports.toAccountTypeStrict = toAccountTypeStrict;
|
|
35
|
-
/** Account types used for payment-account filters (e.g. transaction filter "payment account name"). */
|
|
36
|
-
exports.PAYMENT_ACCOUNT_TYPES = ['bank', 'credit_card'];
|
|
37
|
-
function isPaymentAccountType(accountType) {
|
|
38
|
-
return (accountType != null &&
|
|
39
|
-
exports.PAYMENT_ACCOUNT_TYPES.includes(accountType));
|
|
40
|
-
}
|
|
41
34
|
const ALL_ACCOUNT_LABELS = [
|
|
42
35
|
'uncategorized_income',
|
|
43
36
|
'uncategorized_expense',
|