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

TCCP: Cleanup detail page fee logic #8417

Merged
merged 2 commits into from
May 17, 2024
Merged

TCCP: Cleanup detail page fee logic #8417

merged 2 commits into from
May 17, 2024

Conversation

chosak
Copy link
Member

@chosak chosak commented May 14, 2024

This PR simplifies some of the logic on the TCCP card detail page, removing code that tried to determine if a card has a varying periodic fee. The dataset schema doesn't provide enough information for us to reliably report this to users.

This change simplifies the fee rendering so that we only show annual, monthly, and weekly fees, without information on periodic changes.

See internal https://github.local/Design-Development/Design-Thinking-and-User-Research/issues/306#issuecomment-354469 for additional context behind this change.

How to test this PR

To test, run a local server with the latest data and visit a card page with fees, for example
http://localhost:8000/consumer-tools/credit-cards/explore-cards/cards/credit-one-bank-national-association-platinum-visa-for-rebuilding-credit/.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines

@chosak chosak requested a review from niqjohnson May 14, 2024 19:34
Copy link
Member

@niqjohnson niqjohnson left a comment

Choose a reason for hiding this comment

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

Looks great, even if I'm a little sad we have to remove some of the details because the data isn't structured enough. All the cards I spot checked were showing up as I'd expect. I left one suggestion that might just be me misunderstanding the data, so feel free to ignore that one.

@@ -419,30 +400,12 @@ <h2>
</div>
{% endif %}
{% if card.monthly_fee %}
{% if card.annual_fee %}
{% if card.annual_fee or not card.periodic_fee_type %}
Copy link
Member

Choose a reason for hiding this comment

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

I've already forgotten the intricacies of how the periodic fee data is structured, but I think we can get rid of the or not card.periodic_fee_type here and everywhere below. I put it in line 394 because we use the same space we show an annual fee for cards with no periodic fee (we just show it as "$0 annual fee"). But I think not card.periodic_fee_type will never be true here since it's nested under an if card.monthly_fee, which means card.periodic_fee_type should contain at least one item, "Monthly" (in theory, anyway—who knows if there are data errors that prove that assumption wrong).

If I'm misunderstanding that or there's some weird data thing going on that makes the or not card.periodic_fee_type necessary, ignore all that!

This commit simplifies some of the logic on the TCCP card detail page,
removing code that tried to determine if a card has a varying periodic
fee. The dataset schema doesn't provide enough information for us to
reliably report this to users.

This change simplifies the fee rendering so that we only show annual,
monthly, and weekly fees, without information on periodic changes.

See internal
https://github.local/Design-Development/Design-Thinking-and-User-Research/issues/306#issuecomment-354469
for additional context behind this change.

To test, run a local server with the latest data and visit a card page
with fees, for example
http://localhost:8000/consumer-tools/credit-cards/explore-cards/cards/credit-one-bank-national-association-platinum-visa-for-rebuilding-credit/
@chosak chosak enabled auto-merge May 17, 2024 14:57
@chosak chosak added this pull request to the merge queue May 17, 2024
Merged via the queue into main with commit a6e7fe1 May 17, 2024
12 checks passed
@chosak chosak deleted the tccp/detail-fees-cleanup branch May 17, 2024 15:23
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.

None yet

2 participants