@zeniai/client-epic-state 4.12.88 → 4.12.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/lib/commonStateTypes/fileType.d.ts +2 -2
  2. package/lib/commonStateTypes/fileType.js +1 -1
  3. package/lib/entity/account/accountPayload.d.ts +8 -1
  4. package/lib/entity/account/accountPayload.js +15 -7
  5. package/lib/entity/account/accountSelector.d.ts +6 -6
  6. package/lib/entity/account/accountSelector.js +1 -0
  7. package/lib/entity/account/accountState.d.ts +10 -2
  8. package/lib/entity/account/accountState.js +0 -4
  9. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +2 -2
  10. package/lib/entity/accountGroup/accountGroupSelector.d.ts +44 -44
  11. package/lib/index.d.ts +2 -2
  12. package/lib/view/accountList/accountListReducer.d.ts +2 -2
  13. package/lib/view/accountList/accountListReducer.js +0 -2
  14. package/lib/view/accountMappingView/accountMappingPayload.d.ts +0 -2
  15. package/lib/view/accountMappingView/accountMappingPayload.js +55 -100
  16. package/lib/view/accountMappingView/accountMappingReducer.js +40 -14
  17. package/lib/view/accountMappingView/accountMappingState.d.ts +10 -4
  18. package/lib/view/accountMappingView/accountMappingViewSelector.d.ts +2 -2
  19. package/lib/view/accountMappingView/accountMappingViewSelector.js +5 -5
  20. package/lib/view/accountMappingView/fetchAccountListForAccountTypesEpic.js +1 -0
  21. package/lib/view/accountMappingView/saveAccountMappingViewEpic.js +1 -2
  22. package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -2
  23. package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -2
  24. package/lib/view/topEx/topExSelector.d.ts +1 -1
  25. package/lib/view/transactionList/transactionListReducer.d.ts +12 -12
  26. package/package.json +2 -2
@@ -1,3 +1,3 @@
1
- export declare const ALL_FILE_TYPES: readonly ["pdf", "excel", "csv"];
2
- export declare const toFileTypeStrict: (v?: string | undefined) => "excel" | "pdf" | "csv" | undefined;
1
+ export declare const ALL_FILE_TYPES: readonly ["pdf", "excel"];
2
+ export declare const toFileTypeStrict: (v?: string | undefined) => "excel" | "pdf" | undefined;
3
3
  export declare type FileType = NonNullable<ReturnType<typeof toFileTypeStrict>>;
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toFileTypeStrict = exports.ALL_FILE_TYPES = void 0;
4
4
  const stringToUnion_1 = require("./stringToUnion");
5
- exports.ALL_FILE_TYPES = ['pdf', 'excel', "csv"];
5
+ exports.ALL_FILE_TYPES = ['pdf', 'excel'];
6
6
  const toFileTypeStrict = (v) => { var _a; return (0, stringToUnion_1.stringToUnionStrict)((_a = v === null || v === void 0 ? void 0 : v.toLocaleLowerCase()) !== null && _a !== void 0 ? _a : '', exports.ALL_FILE_TYPES); };
7
7
  exports.toFileTypeStrict = toFileTypeStrict;
@@ -8,7 +8,7 @@ export interface AccountBasePayload {
8
8
  account_id: string;
9
9
  account_name: string;
10
10
  labels: string[];
11
- gl_account_labels?: string[];
11
+ tax_1099_config?: Tax1099ConfigPayload;
12
12
  account_type?: string | null;
13
13
  account_sub_type?: string | null;
14
14
  account_description?: string | null;
@@ -17,6 +17,13 @@ export interface AccountBasePayload {
17
17
  qbo_id?: string;
18
18
  coa_id?: string | null;
19
19
  }
20
+ export interface Tax1099ConfigPayload {
21
+ is_bank_account: boolean;
22
+ is_expense_account: boolean;
23
+ expense_type: string | null;
24
+ type_1099: string | null;
25
+ box_type: string | null;
26
+ }
20
27
  export interface RecommendedAccountBasePayload extends AccountBasePayload, RecommendationBasePayload {
21
28
  }
22
29
  export declare const mapAccountBasePayloadToAccountBase: (payload: AccountBasePayload) => AccountBase;
@@ -5,10 +5,11 @@ const urlPayload_1 = require("../../commonPayloadTypes/urlPayload");
5
5
  const accountState_1 = require("./accountState");
6
6
  const recommendationPayload_1 = require("../../commonPayloadTypes/recommendationPayload");
7
7
  const mapAccountBasePayloadToAccountBase = (payload) => {
8
- var _a, _b, _c, _d, _e, _f, _g, _h;
8
+ var _a, _b, _c, _d, _e, _f, _g;
9
9
  return ({
10
10
  accountId: (_a = payload.account_id) !== null && _a !== void 0 ? _a : payload.account_name,
11
11
  accountName: payload.account_name,
12
+ tax1099Config: mapTaxConfigPayloadToTaxConfig(payload.tax_1099_config),
12
13
  accountType: (0, accountState_1.toAccountTypeStrict)(payload.account_type),
13
14
  accountSubType: (_b = payload.account_sub_type) !== null && _b !== void 0 ? _b : undefined,
14
15
  accountDescription: (_c = payload.account_description) !== null && _c !== void 0 ? _c : '',
@@ -16,12 +17,7 @@ const mapAccountBasePayloadToAccountBase = (payload) => {
16
17
  logo: payload.logo == null ? undefined : (0, urlPayload_1.toURL)(payload.logo),
17
18
  qboId: (_e = payload.qbo_id) !== null && _e !== void 0 ? _e : undefined,
18
19
  coaId: (_f = payload.coa_id) !== null && _f !== void 0 ? _f : undefined,
19
- labels: [
20
- ...toAccountLabelArray((_g = payload.labels) !== null && _g !== void 0 ? _g : []),
21
- ...(payload.gl_account_labels != null
22
- ? toAccountLabelArray((_h = payload.gl_account_labels) !== null && _h !== void 0 ? _h : [])
23
- : []),
24
- ],
20
+ labels: toAccountLabelArray((_g = payload.labels) !== null && _g !== void 0 ? _g : []),
25
21
  });
26
22
  };
27
23
  exports.mapAccountBasePayloadToAccountBase = mapAccountBasePayloadToAccountBase;
@@ -63,3 +59,15 @@ const mapAccountMetadataPayloadToAccountMetadata = (payload) => {
63
59
  return (Object.assign(Object.assign({}, (0, exports.mapAccountBasePayloadToAccountBase)(payload)), { isSubAccount: (_a = payload.is_sub_account) !== null && _a !== void 0 ? _a : false, parentAccountId: (_b = payload.parent_account_id) !== null && _b !== void 0 ? _b : undefined }));
64
60
  };
65
61
  exports.mapAccountMetadataPayloadToAccountMetadata = mapAccountMetadataPayloadToAccountMetadata;
62
+ function mapTaxConfigPayloadToTaxConfig(tax_1099_config) {
63
+ if (!tax_1099_config) {
64
+ return undefined;
65
+ }
66
+ return {
67
+ isBankAccount: tax_1099_config.is_bank_account,
68
+ isExpenseAccount: tax_1099_config.is_expense_account,
69
+ expenseType1099: tax_1099_config.expense_type,
70
+ type1099: tax_1099_config.type_1099,
71
+ boxType: tax_1099_config.box_type,
72
+ };
73
+ }
@@ -32,7 +32,7 @@ export declare function getAccount(accountState: AccountState, id: {
32
32
  financingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
33
33
  accountId: string;
34
34
  accountName: string;
35
- accountType: "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" | "accounts_1099" | "gl_accounts" | undefined;
35
+ accountType: "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" | undefined;
36
36
  accountSubType: string | undefined;
37
37
  accountDescription: string;
38
38
  last4Digits: string | undefined;
@@ -44,7 +44,7 @@ export declare function getAccount(accountState: AccountState, id: {
44
44
  coaId: string | undefined;
45
45
  classesViewParentId: ClassesViewParentID | undefined;
46
46
  accountsViewParentId: AccountsViewParentID | undefined;
47
- labels: ("prepaid_expenses" | "fixed_assets" | "accounts_1099" | "gl_accounts" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
47
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
48
48
  };
49
49
  export declare function getAccountWithBalance(accountState: AccountState, id: {
50
50
  accountId: ID;
@@ -54,7 +54,7 @@ export declare function getAccountWithBalance(accountState: AccountState, id: {
54
54
  }): {
55
55
  accountId: string;
56
56
  accountName: string;
57
- accountType: "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" | "accounts_1099" | "gl_accounts" | undefined;
57
+ accountType: "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" | undefined;
58
58
  accountSubType: string | undefined;
59
59
  accountDescription: string;
60
60
  last4Digits: string | undefined;
@@ -66,7 +66,7 @@ export declare function getAccountWithBalance(accountState: AccountState, id: {
66
66
  coaId: string | undefined;
67
67
  classesViewParentId: ClassesViewParentID | undefined;
68
68
  accountsViewParentId: AccountsViewParentID | undefined;
69
- labels: ("prepaid_expenses" | "fixed_assets" | "accounts_1099" | "gl_accounts" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
69
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
70
70
  };
71
71
  export declare type AccountReport = ReturnType<typeof getAccount>;
72
72
  export declare type AccountWithBalanceReport = ReturnType<typeof getAccountWithBalance>;
@@ -94,7 +94,7 @@ export declare const getAccountsOrdered: (filter: COABalancesFilter, accountStat
94
94
  financingActivitiesInTimeframe: import("../../commonStateTypes/coaBalance/coaBalancesFilter").COABalancesSlice;
95
95
  accountId: string;
96
96
  accountName: string;
97
- accountType: "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" | "accounts_1099" | "gl_accounts" | undefined;
97
+ accountType: "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" | undefined;
98
98
  accountSubType: string | undefined;
99
99
  accountDescription: string;
100
100
  last4Digits: string | undefined;
@@ -106,7 +106,7 @@ export declare const getAccountsOrdered: (filter: COABalancesFilter, accountStat
106
106
  coaId: string | undefined;
107
107
  classesViewParentId: ClassesViewParentID | undefined;
108
108
  accountsViewParentId: AccountsViewParentID | undefined;
109
- labels: ("prepaid_expenses" | "fixed_assets" | "accounts_1099" | "gl_accounts" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
109
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
110
110
  }[];
111
111
  export declare const getAccountsByType: (accountState: AccountState, accountTypes: AccountType[]) => Partial<Record<AccountType, Account[]>>;
112
112
  export declare const getAccountIdsForTypes: (accountState: AccountState, accountTypes: AccountType[]) => ID[];
@@ -41,6 +41,7 @@ const getAccountBase = (accountState, accountId, reportId) => {
41
41
  return {
42
42
  accountId: account.accountId,
43
43
  accountName: account.accountName,
44
+ tax1099Config: account.tax1099Config,
44
45
  accountType: account.accountType,
45
46
  accountSubType: account.accountSubType,
46
47
  accountDescription: account.accountDescription,
@@ -7,10 +7,10 @@ import { ZeniUrl } from '../../zeniUrl';
7
7
  import { ClassesViewParentID } from '../../commonStateTypes/classesView/nestedClassID';
8
8
  import { RecommendationBase } from '../../commonStateTypes/recommendationBase';
9
9
  import { AccountsViewParentID } from '../../commonStateTypes/accountView/nestedAccountID';
10
- 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" | "accounts_1099" | "gl_accounts";
10
+ 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";
11
11
  export declare type AccountType = ReturnType<typeof toAccountType>;
12
12
  export declare const toAccountTypeStrict: (v: string | null | undefined) => AccountType | undefined;
13
- declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "accounts_1099" | "gl_accounts" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses";
13
+ declare const toAccountLabel: (v: string) => "prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses";
14
14
  export declare type AccountLabel = ReturnType<typeof toAccountLabel>;
15
15
  export declare const toAccountLabelStrict: (v: string | null | undefined) => AccountLabel | undefined;
16
16
  export declare function getAccountKey(reportIdUniqueKey: ReportIDPlusForecastID, accountId: ID, classesViewParentId?: ClassesViewParentID, accountsViewParentId?: AccountsViewParentID): `${string}-cash_balance` | `${string}-card_balance` | `${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}-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_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}-charge_cards` | `${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}-cash_balance+${string}` | `${string}-card_balance+${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}-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_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}-charge_cards+${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}`;
@@ -19,11 +19,19 @@ export interface AccountState {
19
19
  accountsByKey: Record<AccountKey, Account>;
20
20
  }
21
21
  export declare type StatementCloseDay = number | 'LAST_DAY_OF_THE_MONTH';
22
+ export interface Tax1099Config {
23
+ isBankAccount: boolean;
24
+ isExpenseAccount: boolean;
25
+ expenseType1099: string | null;
26
+ type1099: string | null;
27
+ boxType: string | null;
28
+ }
22
29
  export interface AccountBase {
23
30
  accountId: ID;
24
31
  accountName: string;
25
32
  accountDescription: string;
26
33
  labels: AccountLabel[];
34
+ tax1099Config?: Tax1099Config;
27
35
  accountType?: AccountType;
28
36
  accountSubType?: string;
29
37
  last4Digits?: string;
@@ -25,8 +25,6 @@ const ALL_ACCOUNT_TYPES = [
25
25
  'equity',
26
26
  'current_liabilities',
27
27
  'current_assets',
28
- 'accounts_1099',
29
- 'gl_accounts',
30
28
  ];
31
29
  const toAccountType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_ACCOUNT_TYPES);
32
30
  exports.toAccountType = toAccountType;
@@ -40,8 +38,6 @@ const ALL_ACCOUNT_LABELS = [
40
38
  'bank_charges_and_fees',
41
39
  'travel_transportation',
42
40
  'accrued_expenses',
43
- 'accounts_1099',
44
- 'gl_accounts',
45
41
  ];
46
42
  const toAccountLabel = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_ACCOUNT_LABELS);
47
43
  const toAccountLabelStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v !== null && v !== void 0 ? v : '', ALL_ACCOUNT_LABELS);
@@ -24,7 +24,7 @@ export declare const cloneAccountsWithZeroBalance: (accounts: AccountReport[]) =
24
24
  financingActivitiesInTimeframe: import("../..").COABalancesSlice;
25
25
  accountId: string;
26
26
  accountName: string;
27
- accountType: "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" | "accounts_1099" | "gl_accounts" | undefined;
27
+ accountType: "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" | undefined;
28
28
  accountSubType: string | undefined;
29
29
  accountDescription: string;
30
30
  last4Digits: string | undefined;
@@ -36,5 +36,5 @@ export declare const cloneAccountsWithZeroBalance: (accounts: AccountReport[]) =
36
36
  coaId: string | undefined;
37
37
  classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
38
38
  accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
39
- labels: ("prepaid_expenses" | "fixed_assets" | "accounts_1099" | "gl_accounts" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
39
+ labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
40
40
  }[];