@zeniai/client-epic-state 4.16.9 → 4.16.12
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/README.md +0 -78
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +8 -26
- package/lib/entity/chargeCard/chargeCard.js +6 -25
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +5 -41
- package/lib/entity/chargeCard/chargeCardPayload.js +8 -20
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +1 -5
- package/lib/entity/company/companyPayload.d.ts +1 -12
- package/lib/entity/company/companyPayload.js +0 -14
- package/lib/entity/company/companyStateTypes.d.ts +0 -11
- package/lib/entity/depositAccount/depositAccount.d.ts +2 -20
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +1 -22
- package/lib/entity/depositAccount/depositAccountPayload.js +1 -39
- package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
- package/lib/entity/depositAccount/depositAccountReducer.js +2 -8
- package/lib/entity/depositAccount/depositAccountSelector.d.ts +1 -3
- package/lib/entity/depositAccount/depositAccountSelector.js +0 -10
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/entity/tenant/tenantSelector.d.ts +2 -6
- package/lib/entity/tenant/tenantSelector.js +2 -10
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/index.d.ts +18 -20
- package/lib/index.js +29 -42
- package/lib/reducer.d.ts +1 -4
- package/lib/reducer.js +0 -3
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -8
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -16
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/dashboard/dashboardSelector.js +6 -7
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +4 -5
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +6 -18
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +4 -1
- package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +9 -22
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +5 -13
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +115 -245
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +15 -9
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +9 -29
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +40 -108
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +15 -40
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +1 -2
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
- package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
- package/lib/view/settingsView/settingsViewHelpers.js +8 -9
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +1 -6
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +2 -20
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +3 -5
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -8
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +0 -26
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -43
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +9 -104
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +16 -70
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +3 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -11
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -20
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -16
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +4 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +4 -30
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +2 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +14 -26
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +5 -20
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +2 -19
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +3 -15
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +25 -65
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +3 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +11 -45
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +3 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +18 -33
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +8 -41
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +21 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +3 -8
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -3
- package/lib/view/spendManagement/commonSetup/setupViewState.js +1 -13
- package/lib/view/spendManagement/helpers.d.ts +0 -3
- package/lib/view/spendManagement/helpers.js +1 -13
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +1 -6
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +0 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +2 -3
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +19 -44
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +1 -2
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +18 -45
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +5 -17
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +0 -33
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +6 -22
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +60 -176
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +3 -5
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +2 -13
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +2 -5
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +5 -46
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
- package/lib/view/userListView/fetchUserListByTypeEpic.js +3 -4
- package/lib/view/userListView/userListViewPayload.d.ts +0 -11
- package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +2 -4
- package/lib/view/vendorTabView/vendorTabViewReducer.js +2 -15
- package/lib/view/vendorTabView/vendorTabViewState.d.ts +1 -7
- package/lib/view/vendorTabView/vendorTabViewState.js +0 -12
- package/package.json +7 -10
- package/lib/entity/connectedAccount/connectedAccount.d.ts +0 -19
- package/lib/entity/connectedAccount/connectedAccount.js +0 -10
- package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +0 -11
- package/lib/entity/connectedAccount/connectedAccountPayload.js +0 -15
- package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +0 -6
- package/lib/entity/connectedAccount/connectedAccountReducer.js +0 -27
- package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +0 -4
- package/lib/entity/connectedAccount/connectedAccountSelector.js +0 -17
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +0 -41
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +0 -42
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +0 -23
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +0 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +0 -31
- package/lib/view/vendorTabView/vendorTabViewSelector.d.ts +0 -8
- package/lib/view/vendorTabView/vendorTabViewSelector.js +0 -15
package/README.md
CHANGED
|
@@ -13,86 +13,8 @@ Common module for Web, Mobile & Server Side Rendering repos containing requi
|
|
|
13
13
|
- If any tests fail, the build process will be terminated
|
|
14
14
|
- Test files are automatically excluded from the final build output
|
|
15
15
|
|
|
16
|
-
### Test & Typecheck Commands
|
|
17
|
-
|
|
18
|
-
- **Run all tests and typecheck test files:**
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
pnpm test
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
This will typecheck all `.vitest.ts` files and their dependencies, then run the full test suite. The build will fail if there are any TypeScript errors in test files.
|
|
25
|
-
|
|
26
|
-
- **Typecheck only test files:**
|
|
27
|
-
|
|
28
|
-
```sh
|
|
29
|
-
pnpm test:typecheck
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
This will only typecheck `.vitest.ts` files and their dependencies, and print the time taken.
|
|
33
|
-
|
|
34
|
-
- **Typecheck and run a single test file:**
|
|
35
|
-
```sh
|
|
36
|
-
pnpm run test:file <filename-or-unique-substring>
|
|
37
|
-
```
|
|
38
|
-
Example:
|
|
39
|
-
```sh
|
|
40
|
-
pnpm run test:file testTransactionsViewReducer
|
|
41
|
-
```
|
|
42
|
-
This will search for a file in `src/` whose name contains the given string (case-insensitive), typecheck it, and run only its tests.
|
|
43
|
-
- If multiple files match, you'll see a list and must be more specific.
|
|
44
|
-
- If no files match, you'll get an error.
|
|
45
|
-
|
|
46
|
-
#### Note on Typechecking
|
|
47
|
-
|
|
48
|
-
Testing types with `tsc` and Vitest is an experimental feature. Breaking changes might not follow SemVer, so please pin Vitest's version when using it. See [Vitest docs](https://vitest.dev/guide/testing-types.html) for more info.
|
|
49
|
-
|
|
50
16
|
### Vitest
|
|
51
17
|
|
|
52
18
|
- Fast framework for running unit, integration, and component tests in modern TypeScript/JavaScript projects.
|
|
53
19
|
- Provides instant feedback with watch mode, built-in coverage, and Jest-compatible APIs.
|
|
54
20
|
- Recommended for new tests and as a drop-in replacement for legacy Jest/Chai setups.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Available NPM Scripts
|
|
59
|
-
|
|
60
|
-
### Test & Typecheck
|
|
61
|
-
|
|
62
|
-
- `pnpm test` — Typechecks all `.vitest.ts` files and runs the full test suite.
|
|
63
|
-
- `pnpm test:typecheck` — Typechecks only `.vitest.ts` files and their dependencies, prints time taken.
|
|
64
|
-
- `pnpm run test:file <file>` — Typechecks and runs tests for a single file.
|
|
65
|
-
|
|
66
|
-
### Build & Clean
|
|
67
|
-
|
|
68
|
-
- `pnpm build` — Runs ESLint, typechecks, tests, and then cleans up mocks/test helpers.
|
|
69
|
-
- `pnpm only-build` — Runs ESLint and typechecks, then cleans up mocks/test helpers.
|
|
70
|
-
- `pnpm clean` — Removes the `lib` directory.
|
|
71
|
-
|
|
72
|
-
### Lint & Format
|
|
73
|
-
|
|
74
|
-
- `pnpm lint` — Runs ESLint with auto-fix on all JS/TS files.
|
|
75
|
-
- `pnpm format` — Formats all source files with Prettier.
|
|
76
|
-
- `pnpm format-watch` — Formats only changed/added TS/TSX files with Prettier.
|
|
77
|
-
|
|
78
|
-
### Code Quality & Analysis
|
|
79
|
-
|
|
80
|
-
- `pnpm find-dead-code` — Finds unused code using ts-prune.
|
|
81
|
-
- `pnpm find-unused-exports` — Finds unused exports using ts-unused-exports.
|
|
82
|
-
- `pnpm circular-dependency` — Detects circular dependencies using madge.
|
|
83
|
-
|
|
84
|
-
### Release & Versioning
|
|
85
|
-
|
|
86
|
-
- `pnpm prepublishOnly` — Runs branch validation, updates Slack topic, checks version, cleans, and builds before publishing.
|
|
87
|
-
- `pnpm version` — Stages all changes in `src` for versioning.
|
|
88
|
-
- `pnpm postversion` — Pushes commits and tags after version bump.
|
|
89
|
-
- `pnpm check-version` — Checks the current version using a custom script.
|
|
90
|
-
- `pnpm check-dependencies` — Checks dependencies using a custom script.
|
|
91
|
-
- `pnpm clean-resolutions` — Cleans up resolutions using a custom script.
|
|
92
|
-
- `pnpm create-release-branch` — Runs the release branch creation script.
|
|
93
|
-
- `pnpm bump-update-web-app-cockpit-beta` — Runs the cockpit beta update script.
|
|
94
|
-
- `pnpm send-release-notes` — Sends release notes using a custom script.
|
|
95
|
-
- `pnpm update-slack-group-topic` — Updates the Slack group topic using a custom script.
|
|
96
|
-
- `pnpm build-beta-and-copy` — Runs the beta build and copy script.
|
|
97
|
-
- `pnpm pr-approvals-update` — Updates PR approvals using a custom script.
|
|
98
|
-
- `pnpm raise-pr-automation` — Runs the PR automation script.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const toAnimationsFileName: (v: string) => "AIPoweredInvoiceDark" | "AIPoweredInvoiceLight" | "Angry" | "Confetti" | "
|
|
1
|
+
export declare const toAnimationsFileName: (v: string) => "AIPoweredInvoiceDark" | "AIPoweredInvoiceLight" | "Angry" | "Confetti" | "ConfettiExplosion" | "DashboardSidebarBackground" | "DashboardSidebarBottom" | "DashboardSidebarLogoDark" | "DashboardSidebarLogoLight" | "FastestWayDark" | "FastestWayLight" | "FinanceTeamDark" | "FinanceTeamLight" | "Happy" | "MoneyTransferSuccess" | "MultiLevelApprovalDark" | "MultiLevelApprovalLight" | "NotHappy" | "ReceiptDark" | "ReceiptLight" | "ReimburseDark" | "ReimburseLight" | "RewardsDark" | "RewardsDarkHover" | "RewardsLight" | "RewardsLightHover" | "Success" | "VeryHappy" | "ZeniAssist";
|
|
2
2
|
export type AnimationFileName = ReturnType<typeof toAnimationsFileName>;
|
|
@@ -5,7 +5,6 @@ import { CardTypePayload } from './chargeCardPayload';
|
|
|
5
5
|
export interface ChargeCard {
|
|
6
6
|
id: ID;
|
|
7
7
|
type: CardType;
|
|
8
|
-
connectedAccountId: ID;
|
|
9
8
|
cardName: string;
|
|
10
9
|
limit: Amount;
|
|
11
10
|
balance: Amount;
|
|
@@ -21,18 +20,7 @@ export interface ChargeCard {
|
|
|
21
20
|
cardCreaterUserId: ID;
|
|
22
21
|
status: CardStatus;
|
|
23
22
|
billingAddressId: ID;
|
|
24
|
-
|
|
25
|
-
monthlyPurchaseLimit: Amount;
|
|
26
|
-
dailyPurchaseSpends: Amount;
|
|
27
|
-
monthlyPurchaseSpends: Amount;
|
|
28
|
-
dailyWithdrawalLimit: Amount;
|
|
29
|
-
monthlyWithdrawalLimit: Amount;
|
|
30
|
-
dailyWithdrawals: Amount;
|
|
31
|
-
monthlyWithdrawals: Amount;
|
|
32
|
-
isPinSet: boolean;
|
|
33
|
-
isDeleted: boolean;
|
|
34
|
-
cardActivationAttemptHistory: CardActivationOrPinChangeAttemptHistory[];
|
|
35
|
-
cardPinChangeAttemptHistory: CardActivationOrPinChangeAttemptHistory[];
|
|
23
|
+
cardActivationAttemptHistory: CardActivationAttemptHistory[];
|
|
36
24
|
mailingAddressId?: ID;
|
|
37
25
|
cardColorCode?: string;
|
|
38
26
|
createTime?: ZeniDate;
|
|
@@ -46,13 +34,13 @@ export interface ChargeCard {
|
|
|
46
34
|
export interface ChargeCardRecommendation {
|
|
47
35
|
creditLimit: Amount;
|
|
48
36
|
}
|
|
49
|
-
export interface
|
|
50
|
-
|
|
37
|
+
export interface CardActivationAttemptHistory {
|
|
38
|
+
user_id: ID;
|
|
51
39
|
timestamp: ZeniDate;
|
|
52
|
-
|
|
40
|
+
status_code: CardActivationEventCodeType;
|
|
53
41
|
}
|
|
54
|
-
export declare const
|
|
55
|
-
export type
|
|
42
|
+
export declare const toCardActivationEventCodeType: (v: string) => "failed" | "success";
|
|
43
|
+
export type CardActivationEventCodeType = ReturnType<typeof toCardActivationEventCodeType>;
|
|
56
44
|
export interface ChargeCardState {
|
|
57
45
|
chargeCardByID: Record<ID, ChargeCard>;
|
|
58
46
|
}
|
|
@@ -72,18 +60,12 @@ export interface ValidThru {
|
|
|
72
60
|
month: number;
|
|
73
61
|
year: number;
|
|
74
62
|
}
|
|
75
|
-
|
|
76
|
-
export type CreditCardCodeType = ReturnType<typeof toCreditCardCodeType>;
|
|
77
|
-
export declare const toDebitCardCodeType: (v: string) => "business_virtual_debit_card" | "business_physical_debit_card";
|
|
78
|
-
export type DebitCardCodeType = ReturnType<typeof toDebitCardCodeType>;
|
|
79
|
-
export declare const toCardCodeType: (v: string) => "business_physical_credit_card" | "business_virtual_credit_card" | "business_virtual_debit_card" | "business_physical_debit_card";
|
|
63
|
+
declare const toCardCodeType: (v: string) => "business_physical_credit_card" | "business_virtual_credit_card";
|
|
80
64
|
export type CardCodeType = ReturnType<typeof toCardCodeType>;
|
|
81
|
-
export declare const toChargeCardType: (v: string) => "credit_card" | "debit_card";
|
|
82
|
-
export type ChargeCardType = ReturnType<typeof toChargeCardType>;
|
|
83
65
|
export declare const toShippingAddressType: (v: string) => "company_address" | "card_holder_personal_address" | "custom_address";
|
|
84
66
|
export type ShippingAddressType = ReturnType<typeof toShippingAddressType>;
|
|
85
67
|
interface CardType {
|
|
86
|
-
code:
|
|
68
|
+
code: CardCodeType;
|
|
87
69
|
name: string;
|
|
88
70
|
}
|
|
89
71
|
export declare const toCardType: (payload: CardTypePayload) => CardType;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCardAddressType = exports.toCardType = exports.toShippingAddressType = exports.
|
|
3
|
+
exports.toCardAddressType = exports.toCardType = exports.toShippingAddressType = exports.toCardStatusCodeType = exports.toCreditLimitFrequencyCodeType = exports.toCardActivationEventCodeType = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
];
|
|
9
|
-
const toCardActivationOrPinUpdateEventCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_CARD_ACTIVATION_OR_PIN_UPDATE_EVENT_CODE);
|
|
10
|
-
exports.toCardActivationOrPinUpdateEventCodeType = toCardActivationOrPinUpdateEventCodeType;
|
|
5
|
+
const ALL_CARD_ACTIVATION_EVENT_CODE = ['failed', 'success'];
|
|
6
|
+
const toCardActivationEventCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_CARD_ACTIVATION_EVENT_CODE);
|
|
7
|
+
exports.toCardActivationEventCodeType = toCardActivationEventCodeType;
|
|
11
8
|
const ALL_CREDIT_LIMIT_FREQUENCY_TYPE_CODE = [
|
|
12
9
|
'monthly',
|
|
13
10
|
'daily',
|
|
@@ -30,27 +27,11 @@ const ALL_CARD_STATUS_CODE = [
|
|
|
30
27
|
];
|
|
31
28
|
const toCardStatusCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_CARD_STATUS_CODE);
|
|
32
29
|
exports.toCardStatusCodeType = toCardStatusCodeType;
|
|
33
|
-
const
|
|
30
|
+
const CARD_TYPE_CODE = [
|
|
34
31
|
'business_physical_credit_card',
|
|
35
32
|
'business_virtual_credit_card',
|
|
36
33
|
];
|
|
37
|
-
const toCreditCardCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, CREDIT_CARD_TYPE_CODE);
|
|
38
|
-
exports.toCreditCardCodeType = toCreditCardCodeType;
|
|
39
|
-
const DEBIT_CARD_TYPE_CODE = [
|
|
40
|
-
'business_virtual_debit_card',
|
|
41
|
-
'business_physical_debit_card',
|
|
42
|
-
];
|
|
43
|
-
const toDebitCardCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, DEBIT_CARD_TYPE_CODE);
|
|
44
|
-
exports.toDebitCardCodeType = toDebitCardCodeType;
|
|
45
|
-
const CARD_TYPE_CODE = [
|
|
46
|
-
...CREDIT_CARD_TYPE_CODE,
|
|
47
|
-
...DEBIT_CARD_TYPE_CODE,
|
|
48
|
-
];
|
|
49
34
|
const toCardCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, CARD_TYPE_CODE);
|
|
50
|
-
exports.toCardCodeType = toCardCodeType;
|
|
51
|
-
const CHARGE_CARD_TYPE = ['credit_card', 'debit_card'];
|
|
52
|
-
const toChargeCardType = (v) => (0, stringToUnion_1.stringToUnion)(v, CHARGE_CARD_TYPE);
|
|
53
|
-
exports.toChargeCardType = toChargeCardType;
|
|
54
35
|
const SHIPPING_ADDRESS_TYPE = [
|
|
55
36
|
'card_holder_personal_address',
|
|
56
37
|
'company_address',
|
|
@@ -59,7 +40,7 @@ const SHIPPING_ADDRESS_TYPE = [
|
|
|
59
40
|
const toShippingAddressType = (v) => (0, stringToUnion_1.stringToUnion)(v, SHIPPING_ADDRESS_TYPE);
|
|
60
41
|
exports.toShippingAddressType = toShippingAddressType;
|
|
61
42
|
const toCardType = (payload) => ({
|
|
62
|
-
code:
|
|
43
|
+
code: toCardCodeType(payload.code),
|
|
63
44
|
name: payload.name,
|
|
64
45
|
});
|
|
65
46
|
exports.toCardType = toCardType;
|
|
@@ -5,52 +5,21 @@ export interface CardTypePayload {
|
|
|
5
5
|
code: string;
|
|
6
6
|
name: string;
|
|
7
7
|
}
|
|
8
|
-
interface IssueRequestMetadata {
|
|
9
|
-
card_name: string;
|
|
10
|
-
card_type: string;
|
|
11
|
-
purchase_limit: number;
|
|
12
|
-
purchase_limit_frequency: {
|
|
13
|
-
code: string;
|
|
14
|
-
};
|
|
15
|
-
currency_code: string;
|
|
16
|
-
holder_user_id: string;
|
|
17
|
-
unit_credit_account_id: string;
|
|
18
|
-
}
|
|
19
8
|
export interface ChargeCardPayload {
|
|
20
9
|
billing_address_id: string;
|
|
21
10
|
card_type: CardTypePayload;
|
|
22
11
|
card_id: string;
|
|
23
12
|
card_name: string;
|
|
24
|
-
|
|
13
|
+
credit_limit: number;
|
|
25
14
|
balance_amount: number;
|
|
26
15
|
hold_amount: number;
|
|
27
16
|
available_amount: number;
|
|
28
17
|
currency_code: string;
|
|
29
18
|
currency_symbol: string;
|
|
30
|
-
|
|
31
|
-
connected_account_id: string;
|
|
19
|
+
credit_limit_frequency: AllowedValueWithCode;
|
|
32
20
|
holder_user_id: string;
|
|
33
21
|
status: AllowedValueWithCode;
|
|
34
22
|
created_by_user_id: string;
|
|
35
|
-
issue_request_metadata: IssueRequestMetadata | null;
|
|
36
|
-
is_pin_set: boolean;
|
|
37
|
-
card_purchase_limits: {
|
|
38
|
-
daily_purchase_limit: number;
|
|
39
|
-
monthly_purchase_limit: number;
|
|
40
|
-
};
|
|
41
|
-
card_purchase_spends: {
|
|
42
|
-
daily_purchases: number;
|
|
43
|
-
monthly_purchases: number;
|
|
44
|
-
};
|
|
45
|
-
card_withdrawal_limits: {
|
|
46
|
-
daily_withdrawal_limit: number;
|
|
47
|
-
monthly_withdrawal_limit: number;
|
|
48
|
-
};
|
|
49
|
-
card_withdrawals: {
|
|
50
|
-
daily_withdrawal: number;
|
|
51
|
-
monthly_withdrawal: number;
|
|
52
|
-
};
|
|
53
|
-
is_deleted: boolean;
|
|
54
23
|
card_provider: string | null;
|
|
55
24
|
provider_card_id: string | null;
|
|
56
25
|
provider_card_type: string | null;
|
|
@@ -63,19 +32,14 @@ export interface ChargeCardPayload {
|
|
|
63
32
|
create_time: string | null;
|
|
64
33
|
update_time: string | null;
|
|
65
34
|
invite_update_time?: string | null;
|
|
66
|
-
card_activation_attempt_history?:
|
|
67
|
-
card_pin_change_attempt_history?: CardActivationOrPinChangeAttemptHistoryPayload[];
|
|
35
|
+
card_activation_attempt_history?: CardActivationAttemptHistoryPayload[];
|
|
68
36
|
provider_card_create_time?: string | null;
|
|
69
|
-
idempotency_key: string | null;
|
|
70
|
-
provider_last_authorization_fetch_time: string | null;
|
|
71
|
-
provider_last_transaction_fetch_time: string | null;
|
|
72
|
-
zeni_last_transaction_fetch_time: string | null;
|
|
73
37
|
recommendations?: ChargeCardRecommendationPayload[];
|
|
74
38
|
}
|
|
75
39
|
interface ChargeCardRecommendationPayload {
|
|
76
|
-
|
|
40
|
+
credit_limit: AmountPayload;
|
|
77
41
|
}
|
|
78
|
-
interface
|
|
42
|
+
interface CardActivationAttemptHistoryPayload {
|
|
79
43
|
user_id: string;
|
|
80
44
|
timestamp: string;
|
|
81
45
|
status_code: string;
|
|
@@ -9,26 +9,15 @@ const mapChargeCardPayloadToChargeCard = (payload) => {
|
|
|
9
9
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10
10
|
return ({
|
|
11
11
|
id: payload.card_id,
|
|
12
|
-
connectedAccountId: payload.connected_account_id,
|
|
13
12
|
type: (0, chargeCard_1.toCardType)(payload.card_type),
|
|
14
13
|
cardName: payload.card_name.trim(),
|
|
15
|
-
|
|
16
|
-
monthlyPurchaseLimit: (0, amount_1.toAmount)(payload.card_purchase_limits.monthly_purchase_limit, payload.currency_code, payload.currency_symbol),
|
|
17
|
-
dailyPurchaseSpends: (0, amount_1.toAmount)(payload.card_purchase_spends.daily_purchases, payload.currency_code, payload.currency_symbol),
|
|
18
|
-
monthlyPurchaseSpends: (0, amount_1.toAmount)(payload.card_purchase_spends.monthly_purchases, payload.currency_code, payload.currency_symbol),
|
|
19
|
-
dailyWithdrawalLimit: (0, amount_1.toAmount)(payload.card_withdrawal_limits.daily_withdrawal_limit, payload.currency_code, payload.currency_symbol),
|
|
20
|
-
monthlyWithdrawalLimit: (0, amount_1.toAmount)(payload.card_withdrawal_limits.monthly_withdrawal_limit, payload.currency_code, payload.currency_symbol),
|
|
21
|
-
dailyWithdrawals: (0, amount_1.toAmount)(payload.card_withdrawals.daily_withdrawal, payload.currency_code, payload.currency_symbol),
|
|
22
|
-
monthlyWithdrawals: (0, amount_1.toAmount)(payload.card_withdrawals.monthly_withdrawal, payload.currency_code, payload.currency_symbol),
|
|
23
|
-
isPinSet: payload.is_pin_set,
|
|
24
|
-
isDeleted: payload.is_deleted,
|
|
25
|
-
limit: (0, amount_1.toAmount)(payload.purchase_limit, payload.currency_code, payload.currency_symbol),
|
|
14
|
+
limit: (0, amount_1.toAmount)(payload.credit_limit, payload.currency_code, payload.currency_symbol),
|
|
26
15
|
balance: (0, amount_1.toAmount)(payload.balance_amount, payload.currency_code, payload.currency_symbol),
|
|
27
16
|
hold: (0, amount_1.toAmount)(payload.hold_amount, payload.currency_code, payload.currency_symbol),
|
|
28
17
|
available: (0, amount_1.toAmount)(payload.available_amount, payload.currency_code, payload.currency_symbol),
|
|
29
18
|
creditLimitFrequency: {
|
|
30
|
-
code: (0, chargeCard_1.toCreditLimitFrequencyCodeType)(payload.
|
|
31
|
-
name: payload.
|
|
19
|
+
code: (0, chargeCard_1.toCreditLimitFrequencyCodeType)(payload.credit_limit_frequency.code),
|
|
20
|
+
name: payload.credit_limit_frequency.name,
|
|
32
21
|
},
|
|
33
22
|
cardProvider: (_a = payload.card_provider) !== null && _a !== void 0 ? _a : '',
|
|
34
23
|
cardProviderID: (_b = payload.provider_card_id) !== null && _b !== void 0 ? _b : '',
|
|
@@ -55,8 +44,7 @@ const mapChargeCardPayloadToChargeCard = (payload) => {
|
|
|
55
44
|
: payload.create_time != null
|
|
56
45
|
? (0, zeniDayJS_1.date)(payload.create_time)
|
|
57
46
|
: undefined,
|
|
58
|
-
cardActivationAttemptHistory:
|
|
59
|
-
cardPinChangeAttemptHistory: toCardActivationOrPinChangeAttemptHistory(payload.card_pin_change_attempt_history),
|
|
47
|
+
cardActivationAttemptHistory: toCardActivationAttemptHistory(payload.card_activation_attempt_history),
|
|
60
48
|
providerCardCreateTime: payload.provider_card_create_time != null
|
|
61
49
|
? (0, zeniDayJS_1.date)(payload.provider_card_create_time)
|
|
62
50
|
: undefined,
|
|
@@ -66,12 +54,12 @@ const mapChargeCardPayloadToChargeCard = (payload) => {
|
|
|
66
54
|
});
|
|
67
55
|
};
|
|
68
56
|
exports.mapChargeCardPayloadToChargeCard = mapChargeCardPayloadToChargeCard;
|
|
69
|
-
const
|
|
57
|
+
const toCardActivationAttemptHistory = (cardActivationAttemptHistoryPayload) => {
|
|
70
58
|
if (cardActivationAttemptHistoryPayload != null) {
|
|
71
59
|
return cardActivationAttemptHistoryPayload.map((cardActivationAttemptPayload) => ({
|
|
72
|
-
|
|
60
|
+
user_id: cardActivationAttemptPayload.user_id,
|
|
73
61
|
timestamp: (0, zeniDayJS_1.date)(cardActivationAttemptPayload.timestamp),
|
|
74
|
-
|
|
62
|
+
status_code: (0, chargeCard_1.toCardActivationEventCodeType)(cardActivationAttemptPayload.status_code),
|
|
75
63
|
}));
|
|
76
64
|
}
|
|
77
65
|
else {
|
|
@@ -94,6 +82,6 @@ const toValidThru = (expirationDate) => {
|
|
|
94
82
|
};
|
|
95
83
|
const toChargeCardRecommendations = (recommendation) => {
|
|
96
84
|
return {
|
|
97
|
-
creditLimit: (0, amount_1.toAmount)(recommendation.
|
|
85
|
+
creditLimit: (0, amount_1.toAmount)(recommendation.credit_limit.amount, recommendation.credit_limit.currency_code, recommendation.credit_limit.currency_symbol),
|
|
98
86
|
};
|
|
99
87
|
};
|
|
@@ -35,7 +35,7 @@ interface ChargeCardMerchant {
|
|
|
35
35
|
export interface ChargeCardTransactionState {
|
|
36
36
|
chargeCardTransactionById: Record<ID, ChargeCardTransaction>;
|
|
37
37
|
}
|
|
38
|
-
export declare const toCardTransactionTypeCode: (v: string) => "
|
|
38
|
+
export declare const toCardTransactionTypeCode: (v: string) => "purchase";
|
|
39
39
|
export type ChargeCardTransactionTypeCode = ReturnType<typeof toCardTransactionTypeCode>;
|
|
40
40
|
export declare const toCardTransactionStatusCode: (v: string) => "paid" | "canceled" | "authorized" | "declined";
|
|
41
41
|
export type ChargeCardTransactionStatusCode = ReturnType<typeof toCardTransactionStatusCode>;
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toCardTransactionStatusCode = exports.toCardTransactionTypeCode = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
const CHARGE_CARD_TRANSACTION_TYPE_CODE = [
|
|
6
|
-
'purchase',
|
|
7
|
-
'credit_card_credit',
|
|
8
|
-
'expense',
|
|
9
|
-
];
|
|
5
|
+
const CHARGE_CARD_TRANSACTION_TYPE_CODE = ['purchase'];
|
|
10
6
|
const toCardTransactionTypeCode = (v) => (0, stringToUnion_1.stringToUnion)(v, CHARGE_CARD_TRANSACTION_TYPE_CODE);
|
|
11
7
|
exports.toCardTransactionTypeCode = toCardTransactionTypeCode;
|
|
12
8
|
const CHARGE_CARD_TRANSACTION_STATUS_CODE = [
|
|
@@ -137,14 +137,6 @@ interface CompanyChargeCardInfoDataPayload {
|
|
|
137
137
|
};
|
|
138
138
|
charge_cards_credit_account_limit: number;
|
|
139
139
|
}
|
|
140
|
-
interface CompanyDebitCardInfoDataPayload {
|
|
141
|
-
debit_cards_tos_acceptance_time: string | null;
|
|
142
|
-
debit_cards_tos_acceptance_user_id: string | null;
|
|
143
|
-
debit_cards_tos_acceptance_user_agent: string | null;
|
|
144
|
-
debit_cards_tos_acceptance_ip: string | null;
|
|
145
|
-
is_debit_cards_tos_accepted: boolean;
|
|
146
|
-
is_debit_cards_enabled: boolean;
|
|
147
|
-
}
|
|
148
140
|
interface CompanyBillPayInfoPayload {
|
|
149
141
|
bill_pay_info: CompanyBillPayInfoDataPayload;
|
|
150
142
|
}
|
|
@@ -157,9 +149,6 @@ interface CompanyZeniAccountInfoPayload {
|
|
|
157
149
|
interface CompanyChargeCardInfoPayload {
|
|
158
150
|
charge_cards_info: CompanyChargeCardInfoDataPayload;
|
|
159
151
|
}
|
|
160
|
-
interface CompanyDebitCardInfoPayload {
|
|
161
|
-
debit_cards_info: CompanyDebitCardInfoDataPayload;
|
|
162
|
-
}
|
|
163
152
|
interface CompanyMileageConfigInfoPayload {
|
|
164
153
|
mileage_unit_amount: number | null;
|
|
165
154
|
default_mileage_unit_amount: number;
|
|
@@ -280,7 +269,7 @@ interface CompanyOnboardingInfoPayload {
|
|
|
280
269
|
subscription_billing_address_id?: ID;
|
|
281
270
|
onboarding_info?: OnboardingInfoPayload;
|
|
282
271
|
}
|
|
283
|
-
export interface CompanyPayload extends CompanyInfoPayload, CompanyLocaleInfoPayload, CompanyIncInfoPayload, CompanyTaxInfoPayload, CompanyQuestionairePayload, CompanyManagementInfoPayload, CompanyBillPayInfoPayload, CompanyReimbursementInfoPayload, CompanyZeniAccountInfoPayload, CompanyChargeCardInfoPayload,
|
|
272
|
+
export interface CompanyPayload extends CompanyInfoPayload, CompanyLocaleInfoPayload, CompanyIncInfoPayload, CompanyTaxInfoPayload, CompanyQuestionairePayload, CompanyManagementInfoPayload, CompanyBillPayInfoPayload, CompanyReimbursementInfoPayload, CompanyZeniAccountInfoPayload, CompanyChargeCardInfoPayload, CompanyOnboardingInfoPayload, CompanyFeaturesActivationInfoPayload, CompanyConfigInfoPayload {
|
|
284
273
|
}
|
|
285
274
|
export declare const toCompany: (payload: CompanyPayload, companiesPayload: CompanyPayload[], isUpdate?: boolean, companyInStore?: Company, companyIdTenantIdMapping?: Record<ID, ID>) => Company;
|
|
286
275
|
export interface CompanySchemaPayload {
|
|
@@ -215,19 +215,6 @@ const toCompanyChargeCardInfo = (payload) => {
|
|
|
215
215
|
chargeCardsCreditAccountLimit: payload.charge_cards_credit_account_limit,
|
|
216
216
|
});
|
|
217
217
|
};
|
|
218
|
-
const toCompanyDebitCardInfo = (payload) => {
|
|
219
|
-
var _a, _b, _c, _d, _e;
|
|
220
|
-
return ({
|
|
221
|
-
debitCardTOSAcceptanceUserid: (_a = payload === null || payload === void 0 ? void 0 : payload.debit_cards_tos_acceptance_user_id) !== null && _a !== void 0 ? _a : undefined,
|
|
222
|
-
debitCardTOSAcceptanceUserAgent: (_b = payload === null || payload === void 0 ? void 0 : payload.debit_cards_tos_acceptance_user_agent) !== null && _b !== void 0 ? _b : undefined,
|
|
223
|
-
debitCardTOSAcceptanceTime: (payload === null || payload === void 0 ? void 0 : payload.debit_cards_tos_acceptance_time) != null
|
|
224
|
-
? (0, zeniDayJS_1.date)(payload.debit_cards_tos_acceptance_time)
|
|
225
|
-
: undefined,
|
|
226
|
-
debitCardTOSAcceptanceIp: (_c = payload === null || payload === void 0 ? void 0 : payload.debit_cards_tos_acceptance_ip) !== null && _c !== void 0 ? _c : undefined,
|
|
227
|
-
isDebitCardTOSAccepted: (_d = payload === null || payload === void 0 ? void 0 : payload.is_debit_cards_tos_accepted) !== null && _d !== void 0 ? _d : false,
|
|
228
|
-
isDebitCardEnabled: (_e = payload === null || payload === void 0 ? void 0 : payload.is_debit_cards_enabled) !== null && _e !== void 0 ? _e : false,
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
218
|
const toCompanyMileageConfigInfo = (payload) => {
|
|
232
219
|
var _a, _b;
|
|
233
220
|
return ({
|
|
@@ -397,7 +384,6 @@ const toCompany = (payload, companiesPayload, isUpdate, companyInStore, companyI
|
|
|
397
384
|
companyReimbursementInfo: toCompanyReimbursementInfo(payload.reimbursement_info),
|
|
398
385
|
companyZeniAccountInfo: toCompanyZeniAccountInfo(payload.deposit_accounts_info),
|
|
399
386
|
companyChargeCardInfo: toCompanyChargeCardInfo(payload.charge_cards_info),
|
|
400
|
-
companyDebitCardInfo: toCompanyDebitCardInfo(payload.debit_cards_info),
|
|
401
387
|
companyOnboardingInfo: toCompanyOnboardingInfo(payload),
|
|
402
388
|
featuresActivationInfo: toCompanyFeaturesActivationInfo(payload),
|
|
403
389
|
parentSubsidiaryInfo: isUpdate === true && companyInStore
|
|
@@ -142,7 +142,6 @@ export interface Company {
|
|
|
142
142
|
companyReimbursementInfo: CompanyReimbursementInfo;
|
|
143
143
|
companyZeniAccountInfo: CompanyZeniAccountInfo;
|
|
144
144
|
companyChargeCardInfo: CompanyChargeCardInfo;
|
|
145
|
-
companyDebitCardInfo: CompanyDebitCardInfo;
|
|
146
145
|
companyOnboardingInfo: CompanyOnboardingInfo;
|
|
147
146
|
featuresActivationInfo: CompanyFeaturesActivationInfo;
|
|
148
147
|
configInfo: CompanyConfigInfo;
|
|
@@ -207,12 +206,6 @@ interface UserChargeCardInfo {
|
|
|
207
206
|
chargeCardTOSAcceptanceTime?: ZeniDate;
|
|
208
207
|
chargeCardTOSAcceptanceIp?: string;
|
|
209
208
|
}
|
|
210
|
-
interface UserDebitCardInfo {
|
|
211
|
-
isDebitCardTOSAccepted: boolean;
|
|
212
|
-
debitCardTOSAcceptanceUserAgent?: string;
|
|
213
|
-
debitCardTOSAcceptanceTime?: ZeniDate;
|
|
214
|
-
debitCardTOSAcceptanceIp?: string;
|
|
215
|
-
}
|
|
216
209
|
export interface CompanyChargeCardInfo extends UserChargeCardInfo {
|
|
217
210
|
isChargeCardEnabled: boolean;
|
|
218
211
|
chargeCardsCreditAccountLimit: number;
|
|
@@ -222,10 +215,6 @@ export interface CompanyChargeCardInfo extends UserChargeCardInfo {
|
|
|
222
215
|
};
|
|
223
216
|
chargeCardTOSAcceptanceUserid?: ID;
|
|
224
217
|
}
|
|
225
|
-
export interface CompanyDebitCardInfo extends UserDebitCardInfo {
|
|
226
|
-
isDebitCardEnabled: boolean;
|
|
227
|
-
debitCardTOSAcceptanceUserid?: ID;
|
|
228
|
-
}
|
|
229
218
|
export interface CompanyFeaturesActivationInfo {
|
|
230
219
|
isBillPayFeatureEnabled: boolean;
|
|
231
220
|
isReimbursementFeatureEnabled: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Amount } from '../../commonStateTypes/amount';
|
|
2
1
|
import { Balance } from '../../commonStateTypes/balance';
|
|
3
2
|
import { ID } from '../../commonStateTypes/common';
|
|
4
3
|
import { ZeniDate } from '../../zeniDayJS';
|
|
@@ -16,25 +15,8 @@ export interface DepositAccount {
|
|
|
16
15
|
accountBalance: Balance;
|
|
17
16
|
zeniAccountId?: ID;
|
|
18
17
|
}
|
|
19
|
-
export interface DepositAccountWithLimit {
|
|
20
|
-
id: ID;
|
|
21
|
-
accountName: string;
|
|
22
|
-
maskedAccountNumber: string;
|
|
23
|
-
accountStatus: DepositAccountStatus;
|
|
24
|
-
accountBalance: Balance;
|
|
25
|
-
cardLimits: {
|
|
26
|
-
dailyWithdrawalLimit: Amount;
|
|
27
|
-
dailyDepositLimit: Amount;
|
|
28
|
-
dailyPurchaseLimit: Amount;
|
|
29
|
-
dailyCardTransactionLimit: Amount;
|
|
30
|
-
};
|
|
31
|
-
zeniAccountId?: ID;
|
|
32
|
-
createTime?: ZeniDate;
|
|
33
|
-
updateTime?: ZeniDate;
|
|
34
|
-
}
|
|
35
18
|
export interface DepositAccountState {
|
|
36
19
|
depositAccountByID: Record<ID, DepositAccount>;
|
|
37
|
-
depositAccountLimitForChargeCardByID: Record<ID, DepositAccountWithLimit>;
|
|
38
20
|
}
|
|
39
21
|
export interface DepositSubAccountType {
|
|
40
22
|
code: DepositSubAccountTypeCodeType;
|
|
@@ -42,6 +24,6 @@ export interface DepositSubAccountType {
|
|
|
42
24
|
}
|
|
43
25
|
export declare const toDepositSubAccounTypeCodeType: (v: string) => "checking" | "savings";
|
|
44
26
|
type DepositSubAccountTypeCodeType = ReturnType<typeof toDepositSubAccounTypeCodeType>;
|
|
45
|
-
export declare const toDepositAccountStatusType: (v: string) => "
|
|
46
|
-
|
|
27
|
+
export declare const toDepositAccountStatusType: (v: string) => "Closed" | "Open" | "Frozen";
|
|
28
|
+
type DepositAccountStatus = ReturnType<typeof toDepositAccountStatusType>;
|
|
47
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BalancePayload } from '../../commonPayloadTypes/balanceChangePayload';
|
|
2
2
|
import { AllowedValueWithCode } from '../../commonStateTypes/allowedValue';
|
|
3
|
-
import { DepositAccount
|
|
3
|
+
import { DepositAccount } from './depositAccount';
|
|
4
4
|
export interface DepositAccountPayload {
|
|
5
5
|
deposit_account_id: string;
|
|
6
6
|
account_sub_type: AllowedValueWithCode;
|
|
@@ -16,25 +16,4 @@ export interface DepositAccountPayload {
|
|
|
16
16
|
zeni_mapped_account_id?: string;
|
|
17
17
|
}
|
|
18
18
|
export declare const mapDepositAccountPayloadToDepositAccountState: (payload: DepositAccountPayload) => DepositAccount;
|
|
19
|
-
export interface DepositAccountWithLimitPayload {
|
|
20
|
-
deposit_account_id: string;
|
|
21
|
-
account_name: string;
|
|
22
|
-
masked_account_number: string;
|
|
23
|
-
account_status: string;
|
|
24
|
-
balances: BalancePayload;
|
|
25
|
-
limits: {
|
|
26
|
-
card: {
|
|
27
|
-
daily_withdrawal_limit: number;
|
|
28
|
-
daily_deposit_limit: number;
|
|
29
|
-
daily_purchase_limit: number;
|
|
30
|
-
daily_card_transaction_limit: number;
|
|
31
|
-
currency_code: string;
|
|
32
|
-
currency_symbol: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
create_time?: string;
|
|
36
|
-
update_time?: string;
|
|
37
|
-
zeni_mapped_account_id?: string | null;
|
|
38
|
-
}
|
|
39
|
-
export declare const mapDepositAccountWithLimitPayloadToDepositAccountWithLimit: (payload: DepositAccountWithLimitPayload) => DepositAccountWithLimit;
|
|
40
19
|
export declare const getZeniAccountFallbackName: (maskedAccountNumber?: string, accountType?: string) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getZeniAccountFallbackName = exports.
|
|
3
|
+
exports.getZeniAccountFallbackName = exports.mapDepositAccountPayloadToDepositAccountState = void 0;
|
|
4
4
|
const balanceChangePayload_1 = require("../../commonPayloadTypes/balanceChangePayload");
|
|
5
5
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
6
6
|
const depositAccount_1 = require("./depositAccount");
|
|
@@ -24,44 +24,6 @@ const mapDepositAccountPayloadToDepositAccountState = (payload) => {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
exports.mapDepositAccountPayloadToDepositAccountState = mapDepositAccountPayloadToDepositAccountState;
|
|
27
|
-
const mapDepositAccountWithLimitPayloadToDepositAccountWithLimit = (payload) => {
|
|
28
|
-
var _a;
|
|
29
|
-
return ({
|
|
30
|
-
id: payload.deposit_account_id,
|
|
31
|
-
accountName: Boolean(payload.account_name) === true
|
|
32
|
-
? payload.account_name
|
|
33
|
-
: (0, exports.getZeniAccountFallbackName)(payload.masked_account_number),
|
|
34
|
-
accountStatus: (0, depositAccount_1.toDepositAccountStatusType)(payload.account_status),
|
|
35
|
-
maskedAccountNumber: payload.masked_account_number,
|
|
36
|
-
accountBalance: (0, balanceChangePayload_1.mapBalancePayloadToBalance)(payload.balances),
|
|
37
|
-
createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
|
|
38
|
-
updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : undefined,
|
|
39
|
-
zeniAccountId: (_a = payload.zeni_mapped_account_id) !== null && _a !== void 0 ? _a : undefined,
|
|
40
|
-
cardLimits: {
|
|
41
|
-
dailyWithdrawalLimit: {
|
|
42
|
-
amount: payload.limits.card.daily_withdrawal_limit,
|
|
43
|
-
currencyCode: payload.limits.card.currency_code,
|
|
44
|
-
currencySymbol: payload.limits.card.currency_symbol,
|
|
45
|
-
},
|
|
46
|
-
dailyDepositLimit: {
|
|
47
|
-
amount: payload.limits.card.daily_deposit_limit,
|
|
48
|
-
currencyCode: payload.limits.card.currency_code,
|
|
49
|
-
currencySymbol: payload.limits.card.currency_symbol,
|
|
50
|
-
},
|
|
51
|
-
dailyPurchaseLimit: {
|
|
52
|
-
amount: payload.limits.card.daily_purchase_limit,
|
|
53
|
-
currencyCode: payload.limits.card.currency_code,
|
|
54
|
-
currencySymbol: payload.limits.card.currency_symbol,
|
|
55
|
-
},
|
|
56
|
-
dailyCardTransactionLimit: {
|
|
57
|
-
amount: payload.limits.card.daily_card_transaction_limit,
|
|
58
|
-
currencyCode: payload.limits.card.currency_code,
|
|
59
|
-
currencySymbol: payload.limits.card.currency_symbol,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
exports.mapDepositAccountWithLimitPayloadToDepositAccountWithLimit = mapDepositAccountWithLimitPayloadToDepositAccountWithLimit;
|
|
65
27
|
const getZeniAccountFallbackName = (maskedAccountNumber, accountType) => {
|
|
66
28
|
const preText = accountType != null ? `${accountType} ` : '';
|
|
67
29
|
const text = maskedAccountNumber !== null && maskedAccountNumber !== void 0 ? maskedAccountNumber : '';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DepositAccountState } from './depositAccount';
|
|
2
|
-
import { DepositAccountPayload
|
|
2
|
+
import { DepositAccountPayload } from './depositAccountPayload';
|
|
3
3
|
export declare const initialState: DepositAccountState;
|
|
4
|
-
export declare const updateDepositAccounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<DepositAccountPayload[], "depositAccount/updateDepositAccounts">, removeDepositAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "depositAccount/removeDepositAccount">,
|
|
4
|
+
export declare const updateDepositAccounts: import("@reduxjs/toolkit").ActionCreatorWithPayload<DepositAccountPayload[], "depositAccount/updateDepositAccounts">, removeDepositAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "depositAccount/removeDepositAccount">, clearAllDepositAccounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"depositAccount/clearAllDepositAccounts">;
|
|
5
5
|
declare const _default: import("redux").Reducer<DepositAccountState>;
|
|
6
6
|
export default _default;
|