Skip to content

Commit

Permalink
chore: [IOBP-1050] Rename biz events in receipt (#6540)
Browse files Browse the repository at this point in the history
## Short description
This pull request includes significant changes to the payments module,
primarily related to the removal of the `bizEventsTransaction` feature
and the introduction of a new `receipt` feature. The changes involve
updates to the navigation, sagas, reducers, and various other files to
reflect this transition.

## How to test
Ensure that all `bizEvents` functionality remains unchanged

Co-authored-by: Alessandro <[email protected]>
  • Loading branch information
LeleDallas and Hantex9 authored Dec 16, 2024
1 parent 2195185 commit 89e1a80
Show file tree
Hide file tree
Showing 60 changed files with 559 additions and 700 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,23 +178,6 @@ exports[`featuresPersistor should match snapshot 1`] = `
"isMixpanelInitialized": false,
},
"payments": {
"bizEventsTransaction": {
"cancelTransactionRecord": {
"kind": "PotNone",
},
"details": {
"kind": "PotNoneLoading",
},
"latestTransactions": {
"kind": "PotNone",
},
"receiptDocument": {
"kind": "PotNone",
},
"transactions": {
"kind": "PotNoneLoading",
},
},
"checkout": {
"allPaymentMethods": {
"kind": "PotNone",
Expand Down Expand Up @@ -258,6 +241,23 @@ exports[`featuresPersistor should match snapshot 1`] = `
},
},
"paymentsBackoffRetry": {},
"receipt": {
"cancelTransactionRecord": {
"kind": "PotNone",
},
"details": {
"kind": "PotNoneLoading",
},
"latestTransactions": {
"kind": "PotNone",
},
"receiptDocument": {
"kind": "PotNone",
},
"transactions": {
"kind": "PotNoneLoading",
},
},
"wallet": {
"userMethods": {
"kind": "PotNoneLoading",
Expand Down
67 changes: 0 additions & 67 deletions ts/features/payments/bizEventsTransaction/navigation/navigator.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions ts/features/payments/bizEventsTransaction/navigation/params.ts

This file was deleted.

14 changes: 0 additions & 14 deletions ts/features/payments/bizEventsTransaction/navigation/routes.ts

This file was deleted.

54 changes: 0 additions & 54 deletions ts/features/payments/bizEventsTransaction/saga/index.ts

This file was deleted.

98 changes: 0 additions & 98 deletions ts/features/payments/bizEventsTransaction/store/actions/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions ts/features/payments/bizEventsTransaction/store/selectors/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions ts/features/payments/bizEventsTransaction/types/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
import { walletPaymentSelectedPspSelector } from "../store/selectors/psps";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { getPaymentsLatestBizEventsTransactionsAction } from "../../bizEventsTransaction/store/actions";
import { getPaymentsLatestReceiptAction } from "../../receipts/store/actions";
import { usePaymentReversedInfoBottomSheet } from "../hooks/usePaymentReversedInfoBottomSheet";
import { WalletPaymentStepEnum } from "../types";
import { requestAppReview } from "../../../../utils/storeReview";
Expand Down Expand Up @@ -130,7 +130,7 @@ const WalletPaymentOutcomeScreen = () => {
};

const handleClose = () => {
dispatch(getPaymentsLatestBizEventsTransactionsAction.request());
dispatch(getPaymentsLatestReceiptAction.request());
if (
onSuccessAction === "showHome" ||
onSuccessAction === "showTransaction"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { renderScreenWithNavigationStoreContext } from "../../../../../utils/tes
import { PaymentsCheckoutRoutes } from "../../navigation/routes";
import { WalletPaymentOutcomeScreen } from "../WalletPaymentOutcomeScreen";
import { WalletPaymentOutcomeEnum } from "../../types/PaymentOutcomeEnum";
import { getPaymentsLatestBizEventsTransactionsAction } from "../../../bizEventsTransaction/store/actions";
import { getPaymentsLatestReceiptAction } from "../../../receipts/store/actions";
import * as useIO from "../../../../../store/hooks";

jest.mock("react-native-store-review", () => ({
Expand Down Expand Up @@ -46,7 +46,7 @@ describe("WalletPaymentOutcomeScreen for all outcomes", () => {
const { getByTestId } = renderComponent(WalletPaymentOutcomeEnum.SUCCESS);
fireEvent.press(getByTestId("wallet-payment-outcome-success-button"));
expect(mockedDispatch).toHaveBeenCalledWith(
getPaymentsLatestBizEventsTransactionsAction.request()
getPaymentsLatestReceiptAction.request()
);
});
});
4 changes: 2 additions & 2 deletions ts/features/payments/common/saga/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { paymentsGetPagoPaPlatformSessionTokenAction } from "../store/actions";
import { walletApiBaseUrl, walletApiUatBaseUrl } from "../../../../config";
import { watchPaymentsMethodDetailsSaga } from "../../details/saga";
import { watchPaymentsWalletSaga } from "../../wallet/saga";
import { watchPaymentsBizEventsTransactionSaga } from "../../bizEventsTransaction/saga";
import { watchPaymentsReceiptSaga } from "../../receipts/saga";
import { handlePaymentsSessionToken } from "./handlePaymentsSessionToken";
import { handleResumePaymentsPendingActions } from "./handleResumePaymentsPendingActions";

Expand Down Expand Up @@ -43,6 +43,6 @@ export function* watchPaymentsSaga(walletToken: string): SagaIterator {
yield* fork(watchPaymentsWalletSaga, walletClient);
yield* fork(watchPaymentsOnboardingSaga, walletClient);
yield* fork(watchPaymentsMethodDetailsSaga, walletClient);
yield* fork(watchPaymentsBizEventsTransactionSaga, transactionClient);
yield* fork(watchPaymentsReceiptSaga, transactionClient);
yield* fork(watchPaymentsCheckoutSaga, paymentClient);
}
4 changes: 2 additions & 2 deletions ts/features/payments/common/store/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { PaymentsOnboardingActions } from "../../../onboarding/store/actions";
import { PaymentsCheckoutActions } from "../../../checkout/store/actions";
import { PaymentsHomeActions } from "../../../home/store/actions";
import { PaymentsWalletActions } from "../../../wallet/store/actions";
import { PaymentsTransactionBizEventsActions } from "../../../bizEventsTransaction/store/actions";
import { PaymentsReceiptActions } from "../../../receipts/store/actions";

import { NetworkError } from "../../../../../utils/errors";
import { SessionTokenResponse } from "../../../../../../definitions/pagopa/platform/SessionTokenResponse";
Expand Down Expand Up @@ -55,4 +55,4 @@ export type PaymentsActions =
| PaymentsHistoryActions
| PaymentsHomeActions
| PaymentsWalletActions
| PaymentsTransactionBizEventsActions;
| PaymentsReceiptActions;
Loading

0 comments on commit 89e1a80

Please sign in to comment.