Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Bonus Pagamenti Digitali): [#175683801] When credit card has been added, join BPD or enroll the new method to BPD #2399

Merged
merged 15 commits into from
Nov 19, 2020

Conversation

Undermaken
Copy link
Contributor

Short description

When a new credit card has been successfully added, this PR adds the ability to join BPD or enroll the new payment method added.

condition action
!isNewMethodBpdCompliant do nothing
isNewMethodBpdCompliant && !bpdActivationStatus ask to user to join BPD
isNewMethodBpdCompliant && bpdActivationStatus ask to user to activate that method to BPD
BPD NOT activated BPD activated
BPD NOT activated BPD activated

when new credit card has been added navigate to join bpd / enroll the new method on bpd
@Undermaken Undermaken changed the title [#175683801] When credit card has been added join BPD or enroll the new method on BPD [#175683801] When credit card has been added, join BPD or enroll the new method to BPD Nov 18, 2020
@pagopa-github-bot pagopa-github-bot changed the title [#175683801] When credit card has been added, join BPD or enroll the new method to BPD feat(Bonus Pagamenti Digitali): [#175683801] When credit card has been added, join BPD or enroll the new method to BPD Nov 18, 2020
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Nov 18, 2020

Affected stories

  • 🌟 #175683801: Come CIT voglio avere la possibilità di attivare il cashback in seguito all'onboarding di un metodo di pagamento

Generated by 🚫 dangerJS against f922f30

@Undermaken Undermaken marked this pull request as ready for review November 18, 2020 08:52
Copy link
Contributor

@fabriziofff fabriziofff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On final note, when adding a new credit card the confirmation message that was displayed when returning to the wallet is no longer present.

Comment on lines 29 to 42
const ActivateBpdOnNewBancomatScreen: React.FunctionComponent<Props> = props => {
const ActivateBpdOnNewPaymentMethodScreen: React.FunctionComponent<Props> = props => {
const { headerTitle, title, body1, body2, skip, continueStr } = loadLocales();
// show new added methods from navigation params
// if they aren't, read the new bancomat added from the store
const newMethodsAdded =
props.navigation.getParam("newAddedMethods") ?? props.newBancomat;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to be ready for the next payments methods, would be nice to transform ActivateBpdOnNewBancomatScreen -> ActivateBpdOnNewPaymentMethodScreen, a component that accepts as props: paymentMethods: ReadonlyArray<PatchedWalletV2> and than add:

const ActivateBpdOnNewBancomatScreen: React.FunctionComponent<Props> = props => (
<ActivateBpdOnNewPaymentMethodScreen paymentMethods={props.newBancomat} />
);

const mapStateToProps = (state: GlobalState) => ({
  newBancomat: onboardingBancomatAddedPansSelector(state)
});
const ActivateBpdOnNewCreditCardScreen: React.FunctionComponent<Props> = props => (
<ActivateBpdOnNewPaymentMethodScreen paymentMethods={props.navigation.getParam("newAddedMethods")} />
);

In this way we can reuse the ActivateBpdOnNewPaymentMethodScreen also for future payments type that can be read from store or from navigation props.
What you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update within b40f05a

Comment on lines 334 to 336
// remove these screen from the navigation stack: method choice, credit card form, credit card resume
yield put(navigationHistoryPop(3));
return;
Copy link
Contributor

@fabriziofff fabriziofff Nov 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a problem because we have a story that ask us to add a credit card without the method choice https://www.pivotaltracker.com/story/show/175757212
We could accept this implementation but we should freeze the credit card onboarding workflow and reject this request.

@codecov-io
Copy link

codecov-io commented Nov 18, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@f6ec61d). Click here to learn what that means.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2399   +/-   ##
=========================================
  Coverage          ?   50.11%           
=========================================
  Files             ?      658           
  Lines             ?    18521           
  Branches          ?     3614           
=========================================
  Hits              ?     9282           
  Misses            ?     9191           
  Partials          ?       48           
Impacted Files Coverage Δ
...es/wallet/onboarding/bancomat/navigation/routes.ts 100.00% <ø> (ø)
ts/sagas/wallet.ts 21.46% <41.66%> (ø)
...creens/bpd/ActivateBpdOnNewPaymentMethodScreen.tsx 84.21% <84.21%> (ø)
...es/wallet/onboarding/bancomat/navigation/action.ts 100.00% <100.00%> (ø)
...wallet/onboarding/bancomat/navigation/navigator.ts 100.00% <100.00%> (ø)
...mat/screens/bpd/ActivateBpdOnNewBancomatScreen.tsx 100.00% <100.00%> (ø)
...t/screens/bpd/ActivateBpdOnNewCreditCardScreen.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6ec61d...16938ed. Read the comment docs.

@fabriziofff fabriziofff merged commit 86fb44c into master Nov 19, 2020
@fabriziofff fabriziofff deleted the 175683801-enroll-cashback-after-payment-method branch January 21, 2022 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants